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.
Dropdown menu
In this lesson we'll learn how can we select links from a drop down menu like this one right here. So there are two actions which we must perform that is we will first of all make the drop down menu visible by clicking on this button and then we will select our drop down link. So let's go ahead and click on this drop down button. And now if I go ahead and inspect the same, you can see we have something like a button element and the button element has an id of button group drop one. So let's go ahead and select it using CSS selectors. So we have our drop down and then I can say page locator because we are using CSS selector. We will specify the tag name and then for the ID we'll start with the hash and then the ID value that is button group drop one. And now I can go ahead and make the drop down menu visible by clicking on our drop down button. So let's click the same. You can see the drop down menu is now visible and we can go ahead and inspect the same as well. That is the link right…
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.