From the course: Robot Framework Test Automation: Level 2

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Partial locators: starts-with

Partial locators: starts-with

- [Instructor] When you're automating web applications, you're definitely going to come across situations where the locator your trying to use has what we call dynamic attributes. And what I mean by that is if you're depending upon an ID, or a type or a class, the value for that attribute is not always going to be static. It might change anytime you log into the site, or anytime you visit the page. Sometimes the beginning of the attribute value will be dynamic, sometimes the end of the attribute value will be dynamic, and sometimes the beginning and the end of the attribute value will be dynamic. In those cases you're going to use what we call partial locators to be able to find the desired element. Here on the screen I've got some example click element keywords with Xpath and CSS locators. And in yellow, I've highlighted the differences between using a partial locator versus our normal static basic syntax. You can see the XPath syntax deviates quite a bit from the standard basic…

Contents