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.
UI testing class attribute
From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
UI testing class attribute
For this test case, we have to select a primary button that is blue in color and with the class of button primary, which is saved or mentioned in the info section. Now if I go ahead and inspect the same, you will see we have three buttons with the same tag name, that is the role and the same text on the same. going to use our rule locator. Instead, we have to use the class names of our buttons, you will see that this button right here, which is our primary button, which we have to locate has class one inside of it. Now you may think we can go ahead and just use the same. Well, notice the position of the buttons. If I go ahead and reload the page, notice that now it has changed. So the position of the buttons is generated dynamically. And so does this class one, two, and three. So we cannot rely on the same to select our primary button. Instead, we can use the button hyphen primary class to identify our button. So let's go ahead and use CSS selectors to select this element based on the…
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)
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)
-
-
-
-
-
-
-
-
-
-