From the course: Robot Framework Test Automation: Level 2

Web locators advanced overview

- [Instructor] In this section about advanced locators we're going to develop the skill of being able to create locators by hand. And also to be able to better understand the locator suggestions given to us by FirePath, so we can potentially optimize them if necessary. The first thing we'll cover is basic XPath and CSS syntax and use. And that, alone, will give you some interesting power to be able to build locators by hand. What you're going to find though, is in certain circumstances you're going to get more than one result back. And in those cases we have to move on to the next lecture about using parent, child, and sibling relationships to be more specific about the locator we're looking for. And in this lecture we're going to cover absolute and relative relationships. And sometimes you'll be faced with web elements whose attributes have values that are dynamic, meaning they change every time you login or use the site. So in cases like that, we'll need to build locators that find elements by partial value. And in this lecture we'll cover starts with, ends with, and contains, to ensure we have the flexibility if the dynamic portion of the locator is at the beginning, end, or in the middle. So let's get started.

Contents