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.
Playwright Python REPL
From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Playwright Python REPL
In the previous section, we learned how can we create a simple playwright script to launch a browser, open a new page, visit a website, locate a button and click the same. In this section, we'll learn more about these locators and all the different ways playwright has to offer to select web elements. Now previously we learned about the get by role selector and what it does is allows us to select elements based on their role and the name attached to the same. We selected a link element with the name of dogs. Now if we would like we can select others as well. That is we can select a link element with the get started text on it. So we can just go ahead and run our script. So py app.py. Now you will see I use the py command instead of Python because I have ADS dead. You can do that as well. But let's just go ahead and run the app and you will see that it clicks on the get started button and goes inside of the intro. Now similarly we can virtually select any element with the role of a link…
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)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-