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.

Locate new emails

Locate new emails

In this lesson, we'll go ahead and find the locators for our e-mail elements and also find out the ones which are new and the ones that are old. So let's go ahead and visit the Gmail website. So HTTPS, gmail.com. And one thing I should mention as well, that is I have this terminal session which uses that is reuses our authentication state. Good. Now, when we visit gmail.com, we get indirected to the inbox, which should be the case. And here you can see we have two e-mail elements. One is new, one is old. So what should we do is find the new ones and report their count. That is in this case, there is only one new one with its sender name that is this right here and a short message like this one right here so let's jump on to the developer tools and inspect this element right here okay you can see it is a tr element which stands for a table row so we definitely have a table as well which is right here so what we can do is find or locate all of the tr elements and then filter them out if…

Contents