From the course: Robot Framework Test Automation: Level 2

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Absolute relationships (XPath and CSS)

Absolute relationships (XPath and CSS) - Selenium Tutorial

From the course: Robot Framework Test Automation: Level 2

Absolute relationships (XPath and CSS)

- [Bryan] As you were experimenting with your new locator skills, you undoubtedly learned that it's very easy to create a locator that finds more than one element on a page. Most of the time in test automation, our goal is going to be to find a single element to click on, or input text, or get text. In a later video I will show us an examples, where it is beneficial to find multiple elements on a page, but for now our goal is still to find a single element to interact with. More often than you might expect, you're going to need to interact with elements that simply do not have very many attributes on them. And when there are multiple tags of the same type, that don't have unique attributes, you have to resort to a different strategy to be able to isolate one of those unique tags. The way we do that is by leveraging tag relationships, as you saw in the HTML CSS primer, tags can be nested within one another, so inside an HTML tag, you can add multiple div tags, and inside those div…

Contents