From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Locator title
In this lesson, we'll learn about the get by title locator. It helps you locate elements based on their title attribute. Now some elements has the title attribute like this attribute element right here. If I go ahead and inspect it, you can see it as a abbreviation element right here with a title property set to attribute. So we can go ahead and select the same if we want. To do that, we can just use page get by title and the value the title attribute has in this case is attribute. So I can just give it that and highlight the same. You can see our attribute elements or the abbreviation element is getting highlighted. Similarly, we can select these elements that is the quotes or the source. So if I go ahead and highlight it, you can see it is a citation that is the source title with the title attributes set to the same thing. And because it's a dummy data, the source title would have been a real name of a person. But we can just use this title element to select it. So we can again use…
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
-
-
-
(Locked)
Playwright Python REPL8m 40s
-
(Locked)
Locator role8m 26s
-
(Locked)
Locators input field3m 39s
-
(Locked)
Locator text4m 6s
-
(Locked)
Locator alt text2m 22s
-
(Locked)
Locator title1m 56s
-
(Locked)
Locating with CSS selectors10m 7s
-
(Locked)
CSS selectors hierarchy8m 10s
-
(Locked)
CSS selectors pseudo classes9m
-
(Locked)
Locators XPath6m 5s
-
(Locked)
XPath functions7m 4s
-
(Locked)
Other locators10m 59s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-