How to stop jumping to xPath hit on search - Chrome Inspect Elements - html

In my work I write a lot of locators to elements on websites. So I will inspect the element and then manually construct an xPath matching it.
What is driving me crazy is that when using the ctrl+f search bar to construct/verify the locator it jumps to the first element as soon as it gets any sort of match. So if I start writing '//div' and is intending to continue it, it still jumps to the very first div in the code and the element I was trying to construct a locator for disappears from view. Or I will have to start constructing it from the back etc just so it won't find a match until I am done, which just complicates it.
Is there any way of disabling the automatic search? So that it only does the match when pressing enter, or something similar. I have looked through the settings but can't find any way.
Please help, it is driving me insane.

Was running into this same issue and found something that might help.
In Devtools > Settings > Preferences > Global > "Search as you type" checkbox.
Just uncheck that setting and the selector won't match until you hit Enter.
For more context, check out the chrome documentation page about this: https://developer.chrome.com/docs/devtools/dom/

Related

How to see the single result of a HTML search within Google Chrome Dev Tools [duplicate]

As per usual when making automated tests I use "Inspect"(CTRL+SHIFT+I) in Chrome to find element by xpath, id, CSS selector etc.
For example:
//li/a[contains(text(), "Products")]
Above is an xpath from this page. In previous versions of Chrome in "DevTools"/"Elements" after pressing CTRL+F to open the "Find" option and pasting this xpath element is highlighted in DevTools window. In new version of chrome it is not highlighted, the usual "1/1" results is displayed in far right of the "Find" tab.
I've search the internet and Chrome Settings but to no avail.The yellow highlight is time saver and I know for certain that I am using the right element.
Edit: Fixed with Chrome version 84.0.4147.105
Thank you for updates, suggestions, workarounds etc.
Yes, In recent updates of Chrome 84, Find feature is buggy. 3 issues have been reported and those are in unconfirmed status as of now (while writing this answer). You can follow them on below links for more details -
An element in the elements tab is not highlighted if it is only one in the DOM
"Find" feature not working on "Elements" tab
Finding element/xpath wont direct to the object
Update
Elements search does not resolveNode (highlight text, etc) on first search result
Has been fixed and it is part of Version 84.0.4147.105 (Official Build) (64-bit). You just need to update and relaunch the chrome. The issues mentioned above are marked as duplicate to this issue.
The major issue is with DevTools within Google Chrome 84.0 which doesn't highlights the first matched element.
Incase, the locator finds a single match, the search result does show 1 of 1 but the WebElement is not highlighted within the DOM Tree
As an example, the Search Box within the Google Home Page can be identified uniquely using the css-selector:
[name='q']
or using the xpath:
//*[#name='q']
But google-chrome-devtools within Google Chrome 84.0, does finds the element and shows 1 of 1 but the element is not highlighted.
However, if there are multiple element matching to the Locator Strategy, leaving out the first matched element, the other elements are highlighted.
Bug in Chrome 84
This issue was raised in the Platform>DevTools queue through Issue 1108311: The first matched element in the Elements panel is not getting highlighted as per the cssSelector and had been merged into Issue 1103316: Elements search does not resolveNode (highlight text, etc) on first search result where we are actively tracking the issue.
Solution
As per #bugdroid the main issue was caused because a check to ensure the search results were valid did not account for the case where the index was 0, so all highlight results of index 0 (index 1 to the user) were no longer highlighted.
The fix for this issue is Merge-Approved in:
Chrome version 84.0 later then Version 84.0.4147.89.
Chrome version 85.0.
Chrome Canary version 86.0.4201.0.
Alternate Solution
For alternate solutions using the current google-chrome Version 84.0.4147.89 you can find a detailed discussion in Why XPath does not highlighted the yellow mark in Chrome84?
Also as a workaround you can try using chro path extension, where you can paste your written xpath in search box and see element getting highlighted in browser.
Additionally you will be able to get automatic locators formed by chropath itself
I have also faced a similar issue where first matched xpath is not visible in chrome ( mac os mojave).
As a workaround, I am using the chrome console for exactly locating the xpath element.
Steps :
Open developer tools
Click on Console tab
type command as : $x("xpath") and press enter.
Find the below image link for reference.
dev console
Another option is to go to console section and evaluate your xpath like this $x("yourXpath") and hit enter. In the case of google search button woulb be like this: $x("//*[#name='q']") then you hit enter and expand the structure that appears below and if you hover with the mouse, the element is going to be highlighted.
I had the same issue, but the thing is .....
you should after you position your cursor to a particular text or control or button(etc) that you wish to inspect, then right click and choose Inspect element, then in the area where you see the code...I mean in Element tab of the opened DevTools, keeping your cursor on the text of the code at any place, then click Ctrl+F and it will open a search field
and then you type an absolute or relative xpath of your element that you would like to find and when the path is correct, your text will be highlighted with yellow.
Surprisingly, if I just move my cursor out of element tab and still do Ctrl+F, the search field will open, but the element is not highlighted in yellow as before
I had started using firefox!
It is being fixed by chromium - https://bugs.chromium.org/p/chromium/issues/detail?id=1103316.
Should be out soon.

Codeception can't click on element it has seen just before

Hello dear people of Stackoverflow,
currently I am writing acceptance tests with Codeception using Selenium as WebDriver module. In my test to check if our sub-navigation exists, is complete and works I struggle with the following piece of code:
$I->see('Partners');
$I->click('Partners');
all the see calls are working perfectly, but the click call fails with an ElementNotVisibleException stating that the element to be clicked is not visible, which I don't understand since the see call worked.
To make sure we're not seeing any old "Partners" string on the page but it really is the link I want to click, I changed the call by adding the a selector.
$I->see('Partners', 'a');
$I->click('Partners');
Still, I'm getting the ElementNotVisibleException from before. In the next step, I added a context to the click call to this:
$I->click('Partners', 'a');
Which made the exception disappear. Still, the click never happens, the test simply fails with the message:
Link or Button or CSS or XPath element with 'Partner' was not found.
I even used XPath in the click call like this: //a[text()='Partners'] and get the same message.
What bothers me the most with this is that the see call seems to see the link I am trying to click and moreover, even the page source and screenshot provided by Codeception after a fail contain this very link, visible and in valid HTML.
I tried to click on some other elements within the sub-navigation with the same result, while - which is even more strange - clicks on links in the main navigation seem to work just fine.
I have no idea why this doesn't work but any help is greatly appreciated.
I don't understand exactly why it happens in some cases and not others, but I've found a solution that works for me: Use CSS selectors only.
Basically in some cases (I think it has to do with clicking on div/span rather than a/button) ->see() will work with the fuzzy text string as first argument, but ->click() requires the explicit CSS selector.
So this will have the "I can see but not click" problems:
// BROKEN
$I->see("All topics", ".header-taxonomy .taxonomy-list-title");
$I->click("All topics", ".header-taxonomy .taxonomy-list-title");
But this will work:
// WORKS
$I->see("All topics", ".header-taxonomy .taxonomy-list-title");
$I->click(".header-taxonomy .taxonomy-list-title");
Obviously it's not ideal at all, partly because it requires a unique selector, but for me mostly just because it makes the tests and testing output less consistent and harder to read.
Either way, I just wanted to get this testing script finished, and now it's working, and because I'm still using ->see() with the fuzzy text locator, I'm still confident that the text is showing before I click.
Notably, this issue doesn't happen when using the PHPBrowser module, which is what tripped me up. I "upgraded" to WebDriver and found my scripts were broken in all these places due to the different behavior of ->click() (in addition to the expected need to open menus before using them, which wasn't needed in PHPBrowser)

ArcMap editor panel window not opening

I have installed ArcMap Desktop 10.5.1 on a new computer and have a problem. I have never experienced with any previous versions of ArcMap.
Pressing the button of the toolbar for the Editor
I can’t access the toolbar.
I also can see that the program notices that I have pressed the button by the ArcMap-window ‘flickering’ and I see the Editor-window that should open for less than a second at some occasions.
I have tried to see if it ends up hidden somewhere, but it does not seems like it.
Printscreen of the ArcMap window with the editor button
Does anyone know what can be the problem and how to handle it?
I have tried to search for answers both at the ESRI help-page, here in stackoverflow and in other broad search engines, but this doesn’t seem to be a common problem.
This problem can have many causes and there are 2 different ways to open the editor toolbar.
Try click Customize > Toolbars > Editor (I will add a pic for it)
Right-click while your mouse on the main menu. The toolbar will be open directly and check the editor. Same solution.
If you have still this problem you must see another reason for the problem.
For example, do you using a second monitor? If you using it maybe the editor toolbar coming from another monitor. Check your monitor/monitors also.
If you still have problems, please write. There is another solution.
However, I am not writing now because it will reset usage of interface.

Is it possible to search in PhpStorm debugger view?

Like in topic, is there any option to find something in PhpStorm Debugger view?
For example I want to find element 39001421 in:
How I can achieve this?
I don't think a simple Ctrl-F works here. Here's one way to do it.
When you hit your breakpoint, press Alt-F8 or from the menu, choose Run -> Evaluate expression. In the window that opens, simply input the expression you would like to evaluate; in your case, something like
$items[39001421]
You'll get the value you're looking for at the bottom of the window.
#LazyOne Did a great job. With his help i think that i have found most effectively way to find something in PhpStorm debugger view. (if you are curious how we were looking for that answer please read comments beneath first post)
Firstly You should shut off variable adress view. (picture 1)
Secondly You should ensure that You have got "Sort Values Alphabetically" option sellected. (dropdown menu inside "gear" icon, picture 2)
Thirdly You should expand what You want to looking in (picture 3)
Next, You can type what You want to search for, If You don't find what you want to find, simply press up or down arrow to show next "occurence".

How to disable the annoying NetBeans auto-suggest while typing

When I am typing in NetBeans 8.2, whether it is a HTML paragraph or something like an input field, this annoying auto-suggest feature keeps on popping up. It is really annoying when I try to press enter to start a new line as it will insert a load of code when I press enter, since 'Button' is automatically highlighted.
I've included a screenshot of the problem below...
How can I disable this autocorrect feature. I don't want to disable autoorrect for PHP or when actually setting up a HTML tag (so I want to use it in a situation like this... <input type="autocorrect displays here" />, but not when typing anything else).
Sorry if I haven't explained myself very well, I can't really think of a good way to describe my problem. Please, leave a commend if you need to know more.
Thanks :)
PS: I can't find any other answers on the internet because I don't know what this is called, since I want this specific auto-suggest to disappear, so please direct me to another answer and I'll delete this question if the answer is appropriate.
PPS: I think the palette may have something to do with it but I can't be sure.
I finally found the solution for this annoying problem:
Simply go to Tools/Palette/Code Clips and remove everything from Palette (all folders and items).
Now the problem is gone!
If you go into NetBeans > Tools > Options > Editor > Code Completion, you can check or uncheck "Auto Popup Completion Window" for whatever Languages you want.
If you move over to the Code Templates tab, you can also customize the specific autocomplete rules for each Language. That way, you can leave certain ones in that you find helpful and remove ones that you find bothersome.
Today I finally had enought of these * autocompletes in my * code.
Found my way thru Google to this question and found no comfort from the answers.
But this is how I did it:
Open Code Clips -manager (Tools > Palette > Code Clips)
Select all HTML-related and click "Remove"
Profit
Apache Netbeans 12.1.
Palette > Code Clips > Remove -- does not work.
NetBeans > Tools > Options > Editor > Code Completion > Disable "Auto popup completion window" -- does work.
In NetBeans 12, disabling the Auto Popup Completion Window option for HTML does not solve the problem when editing PHP files, the popup shows up whenever Tab is pressed in HTML portions of code.
The solution is to keep the Auto Popup Completion Window active for All Languages, then switch to the Code Templates tab, select Language: HTML, remove all templates from the list, and voilá. No more HTML popup suggestions, anywhere, ever. Only the good old PHP suggestions will remain active.