The attribute based locators can be found by directly inspecting the web element in html code of the page. XPath and CSS are structure based locators which relies on the structure of page to find elements. The locators like ID, Name, ClassName, TagName, and LinkText are attribute based as it relies on the attributes of elements for locating elements. The locators used by Selenium can be classified broadly as attribute based locators and structure based locators. Steps are almost same in all the browsers. In this article we would be covering, how to find the locators using web inspector. Hence we are skipping these add-ons in our article. The new version of Firefox does not support these add-ons, but has all the capabilities of these add-ons in its developer tool. But, from Nov’17 Firebug and Firepath tools have been retired. For this, we can use the built in browser inspectors of your browsers or add- ons like Firebug or Firepath for Firefox. This article, we will be seeing how we get the locator values from the html snippet of your web page. In our article on ‘Locators used in Selenium for Object Identification’, we saw the different locators that can be used to identify web elements on a web page and the use of findElement() method for the locators.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |