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.

The importance of specific locators

The importance of specific locators - Selenium Tutorial

From the course: Robot Framework Test Automation: Level 2

The importance of specific locators

- So I'm including one last example here because it's something that could potentially trip up people who are new to test automation and even some more advanced folks as well. Back on this Amazon website here I decide that I want to click on this banner up here at the top right. To me this looks like an image so I would think to myself okay I'm setting up to use my Click Image keyword and if I ctrl + B on this I can get information about what my options are for Click Image. And notice it says, that we have to pass it a locator of course. But it's telling me the key attributes for images are "id" "src" and "alt" So back on the website here if I right-click and Inspect in FirePath right off the bat I see that I do not have an ID. I do have a class. I have a H Ref. And then I find as alt text down here at the bottom. And I think to myself hey I can use Alt text as a key attribute for Click Image. So I copy that text and I paste it in here right after Click Image. And I'm all excited…

Contents