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.
Run tests in parallel
From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Run tests in parallel
in this lesson we will learn how to run multiple tests at once that is running tests in parallel now by default pytest runs our test sequentially that is it runs the test one by one now here I have a test directory with a total of five test files. Now if I go ahead and run the tests using pytest command in the test directory, pytest will collect all of the files and run the test one by one. So let's wait for all of them to finish. Now you can see the total time taken to finish these 6 items was 27.51 seconds. Now it's alright because we only ran 6 items. But if we had more, let's say tens or even hundreds of tests, then this figure will go up pretty quickly. So instead of running a test one by one, what we can do is run multiple at once. To do that, we can make use of the threads of our CPU. As modern day CPUs post multiple threads, mine has 12. So let's go ahead and learn how to use them. To do that, we'll require a pytest plugin. So let's install the same using pip inside of our…
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.
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
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)
-
-
(Locked)
UI testing dynamic ID3m 17s
-
(Locked)
UI testing class attribute3m 19s
-
(Locked)
UI testing hidden layer5m 2s
-
(Locked)
UI testing load delay3m 23s
-
(Locked)
UI testing AJAX request2m 25s
-
(Locked)
UI testing click action2m 4s
-
(Locked)
UI testing input field2m 34s
-
(Locked)
UI testing scrollbars3m 5s
-
(Locked)
UI testing dynamic table9m 45s
-
(Locked)
UI testing verify text2m 5s
-
(Locked)
UI testing progress bar5m 28s
-
(Locked)
UI testing visibility7m 19s
-
(Locked)
UI testing app login5m 30s
-
(Locked)
UI testing mouse hover3m 49s
-
(Locked)
UI testing nbsp character2m 14s
-
(Locked)
UI testing overlapped4m 40s
-
(Locked)