ERJAN
ERJAN

Reputation: 24500

How can I automate clicking and choosing from dropdown menu and saving?

There is a database of students about 200, I need to choose 2 items from dropdown and click on save button at the end. Doing manually takes about 5-6 sec. I want to know if it's possible to automate it? Screenshots below: 1

Then choosing 2 items: 2

3

Finally hit "save"button: 4

Upvotes: 0

Views: 322

Answers (1)

akshay lalwani
akshay lalwani

Reputation: 76

In selenium you could do it like this:

WebElement mySelectElement = driver.findElement(By.id("id of the dropdown"));
Select dropdown= new Select(mySelectElement);
dropdown.selectByIndex(2);//select it by index
driver.findElement(By.id("id of your button")).click();

Upvotes: 2

Related Questions