From the course: Advanced Selenium: Support Classes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

What are locators?

What are locators? - Selenium Tutorial

From the course: Advanced Selenium: Support Classes

Start my 1-month free trial

What are locators?

- [Instructor] Normally we use the ByClass with its static factory methods for creating location strategies. So we have got, using the code completion here, CSS selectors, tag name, id, et cetera. There are also three additional locator classes in the support package. ByIdOName, ByAll, and ByChained and we're going to look at all of those in this video. Let's start with the ByIdOrName find element. If I look at the GUI, in the support class test page we have two buttons and the two buttons have different IDs. The single resend has resend select as an ID, the multi, inspect that, has resend multi. And we can see that the resend multi button has a name of resend select which is the same as the ID of the resend single option message button. So back in the code, the test, first on line 49 finds the first button using the ID, and on line 53, finds the second button using the name. By ID on line 49, by name on line 53.…

Contents