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) - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Web locators advanced overview1m 10s
-
Basic XPath and CSS syntax11m 24s
-
Absolute relationships (XPath and CSS)8m 23s
-
Relative relationships (XPath and CSS)9m 44s
-
Partial locators: starts-with5m 30s
-
Partial locators: ends-with2m 10s
-
Partial locators: contains8m 3s
-
Scenario: Find and use multiple elements5m 7s
-
-
-
-
-
-
-