Tried to find xPath of an element in the latest Chrome (v99). It looks like the right-click menu in Chrome's "inspect" pane is not available. How does one find the xPath of elements for Selenium automation?
Asked
Active
Viewed 40 times
1
-
1Copy-pasting XPaths out of your browser is a really excellent way to write flaky tests... – jonrsharpe Apr 05 '22 at 16:19
-
Well you should write your own xpath, however you'd still need inspect feature so that you can write XPath more effectively/robust. – cruisepandey Apr 05 '22 at 17:41
1 Answers
1
Chrome's Inspect menu item is still available after the right-click.
However, google-chrome latest version is Version 100.x which you need to upgrade to.
Having said that, some websites may disable the right-click for security or some other reasons. In those cases you have use the google-chrome-devtools to identify the desired elements.
You can find a relevant detailed discussion in How to inspect element for Selenium v3.6 as FireBug is not an option any more for FF 56?

undetected Selenium
- 183,867
- 41
- 278
- 352