Skip to main content

How to locate drop down by using Selenium Web Driver

In earlier article we discussed about how to locate Link, Text Box, Button, Radio Button. In this article i want to discuss with you that how we can deal with the drop down boxes. We can call drop down also called select box because Web Driver's support class is Select, which provide useful method to interact with the drop down.
There are 3 method by which Selenium Web driver can interact with the drop down.
1) selectByIndex
Automation Testing, Selenium Web Driver, Select Locator, selectByIndex


In this method we will use the index to select the option.

so if you want to put the value 2 then following will be the script


2)selectByValue
Automation Testing, Selenium Web Driver, Select Locator, selectByValue


In this method we will use the value to select the option.
Suppose you want to select the month "feb" then 




3)selectBYVisibleText
Automation Testing, Selenium Web Driver, Select Locator, selectByVisibleText
In this method we will use the visible text to select the option.
Suppose you want to select the year"1986" then

Comments

Popular posts from this blog

What is API?

In general way, API (Application Programming Interface) is the intermediate software which is useful for two applications to communicate. API is the tool which is used for interaction of two applications. If developer developing any software which have multiple blocks (Modules) than developer use APIs to put them together.

Structural Testing

Structural Testing is the type of testing in which user should have the knowledge of the code because in this testing user need to check the structure of the system. Structural Testing is White Box Testing.