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 dynamic table

UI testing dynamic table

For this test, we will work on dynamic tables. Here we have a simple label with some tasks and their statistics. That is network usage, cpu usage and so on. Then we are given a label which says chrome cpu usage which is the percent right here. Now for this test, we have to expect this value to be equal to the value inside of our table which is this right here. First of all, we have to locate the same inside of our table and we can pretty much do it using the first row inside of our table and the fourth value inside of this row. But if I go ahead and refresh the page, well the things changed. The row of the chrome is now third and the CPU column is now second. Well, difficulty escalated pretty quickly. So what we have to do is handle this dynamic nature of this table when locating our desired value. So if I go ahead and inspect the same, you will find all of the elements having a role. is in the test info it is said that this table follows the y area table design pattern which means…

Contents