0% found this document useful (0 votes)
4 views

Selenium basics

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Selenium basics

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Selenium basics :

1. Press to open up Chrome DevTools.


F12
2. Elements panel should be opened by default.
3. Press Ctrl + F to enable DOM searching in the panel.
4. Type in XPath or CSS selectors to evaluate.
5. If there are matched elements, they will be highlighted in
DOM.

//a[text () = 'Forgot your password?']

//a[contains( text() ,"Forgot your ")]

//a[@href ="/index.php/auth/requestPasswordResetCode"]

//div//a[text()='Forgot your password?']

//input[@id='btnLogin']

//input[@name='txtUsername']

.//span[contains(@class , 'form') and contains(text(),'User')]

.//*[contains(@class , 'form') and contains(text(),'User')]

How to check CSS selector

1) Hover the cursor over the image and right click mouse.
2) Select Inspect.
3) See the highlighted image code.
4) Right click on the highlighted code.
5) Select Copy > Copy selector.

https://opensource-demo.orangehrmlive.com/

#btnLogin

You might also like