O'Reilly logo

Learning Selenium Testing Tools with Python by Unmesh Gundecha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with dropdowns and lists

Selenium WebDriver provides a special Select class to interact with the lists and dropdowns on a web page. For example, in the demo application, you can see a dropdown to select the language for the store. You can choose and set a language for the store as shown in the following screenshot:

Working with dropdowns and lists

Dropdowns or lists are implemented with the <select> element in HTML. The options or choices are implemented with the <options> element within a <select> element as shown in the following HTML code:

<select id="select-language" title="Your Language" onchange="window.location.href=this.value"> <option value="http://demo.magentocommerce.com/?___store=default&amp;___from_store=default" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required