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.

Combine locators

Combine locators

Now that we have figured out the selectors for our emails, we'll go ahead and write them out. So after our navigation, we will go ahead and select all the emails that is inside of a divider with the UI class, we'll have a table and select all the TR elements inside of the same. ahead and store it in the emails and then we'll also create a list of new emails and what it will have is let's say we'll go over all the e-mail elements if we find a new one we will enter another list inside of it and then that will have the data of the sender let's say google and then it will have the short message as the second element let's say it was security alert like this so let's go ahead and do something like this now i can go ahead and run a for loop on these emails and to make it iterable that is make our locator iterable we can use the all method now we can go ahead and just use for e-mail in this iterable we'll get an e-mail in each iteration and now we'll go ahead and find whether or not this is…

Contents