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.
Locators input field
In this lesson, we'll learn how to select input fields using the GetBy label and the GetBy placeholder method. Now let's say we would like to select this input field. And if I go ahead and inspect it, you can see it is a input field. And it also has a label that is e-mail address. Now you will find this pattern in almost every input field. is there is an input field that is this text box and with that you will have a corresponding label that is what it is about in this case it is e-mail address so what we can do is find input fields based on their corresponding labels that's what the get by label method does so let's go ahead and try to locate this so we'll say e-mail input page get by label and we'll just go ahead and pass it the label in this case it is e-mail address so we have the element located we can just use the highlight to highlight it out. You can see it is highlighted. Similarly, we can look out for some other input field. Let's say we want to look out for this password…
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)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-