Skip to main content

Posts

Showing posts from June, 2018

Identify Web Elements using Selenium Xpath Locator

As we all know, Web elements are present diversely (Dropdown, Check Box, Text Box, Radio Button, etc.) in a Web page. And locators are our saviours, right from helping us identify a Web element uniquely within the page to enunciate its HTML properties and informing Selenium about the action to be performed. For example, the Dropdown mandatory field “Highest Qualification” is not with Select Class in the Web page. It is difficult to find the Web element for that field. To resolve this, one may use Xpath Locator and find the element for the “Highest Qualification” field. Also they should try to select the Dropdown field value “Masters” making use of the Action Class. You can find the script but in that, using the Action Class to find the element for the mandatory “Highest Qualification” field will not be fruitful. You may have to apply the Contains text method to find out the element for the Xpath. Identifying Web elements is always a sensitive area and mandates a pr