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.

Clicking link element

Clicking link element

Now that we have created a script to just launch a browser and open the playwrights web page, we can go ahead and click on the docs button. To do that, let's just go ahead and launch the Chrome browser and see the playwright website. And here, what we want to do is click on this button. How do we do that? well the page object that is this right here gives us a lot of methods to access the html elements like the button in this case to do that let's just go ahead and open the developer tools which you can access from the settings more tools developer settings or you can just hit ctrl shift i on your keyboard to open the same. You can see that this is the source code of this website. And I can just go ahead and hit ctrl plus to increase its font size. And now we can just inspect this docs button by clicking this button right here. And now you can see if I hover over any element, we get to see its equivalent html code. And here I'll just hover over this docs, click on that. And now you…

Contents