From the course: Robot Framework Test Automation: Level 2

Unlock this course with a free trial

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

Partial locators: ends-with

Partial locators: ends-with

- [Male Narrator] As I mentioned in the previous video, often times, when you're automating a web application, you're going to encounter locators that have attribute values that are dynamic. In those cases, we need to turn to partial locators to find the elements we're looking for. We just talked about finding elements that start with a particular static string, and that's useful when the end of the attribute value is what's dynamic. There will be times when the beginning of the attribute value was dynamic, so in that case we need to use something like ends-with. And I'm going to point out here that XPath does contain an ends-with function, but it's only available in XPath 2.0 which most modern browsers don't support yet. So, you can see that syntax, very similar to the starts-with syntax, we're just going to replace starts-with with ends-with. So you can give this a try, but it's probably not going to work because most browsers don't support XPath 2.0 yet. So, instead of demoing…

Contents