Verify Xpath And CSS Selector With Chrome Developer Tools

In this article, we will discuss how to verify the xpath and CSS selector using chrome developer tools.

Open the Application which you are testing in Chrome Browser.

Open the developer tools in chrome using the keyboard shortcut ctrl+shift+I or by right clicking and selecting inspect option.

Click the console window

Type the command $x('paste your xpath' here) and click enter, if the xpath is correct then the element will be displayed in the console by the developer tools

Verify xpath and CSS Selector with chrome developer tools

Type the command $$('paste your CSS here') and click enter, if the CSS is correct then the element will be displayed in the console by the developer tools

Verify xpath and CSS Selector with chrome developer tools

Summary

In this article, I discussed how to verify xpath and css selector when we do automation testing. This will be helpful for people who are doing test automation.

Thank you, Happy learning.....


Similar Articles