Thursday 25 February 2016

How to select dropdown values and show a multiple types of operations.

Drop-down values multiple types of selections 



country list


. Dropdown seletion there are multiple type of code in selenium webdriver 


 new select(driver.findelement(By.xpath("//select[@name='country']"))).selectByVisibleText("india");

(or)

webelement country = driver.findElement (By.xpath("//select[@name='country']"));

select  countryname = new select (country);

countryname.selectByVisibleText("india"); 

  (or)

Select country = new  Select(driver.findElement (By.xpath("//select[@name='country']")));

country.selectByVisibleText("india");

 







.  Dropdowns values you can select the required in 3 ways. consider an HTML file 
. In webdriver support SELECT tag , SELECT is a class it is a perform multiple task on dropdowns and  multiple select object.


new Select(driver.findElement(By.name("country"))).selectByVisibleText("India");



new Select(driver.findElement(By.name("country"))).selectByIndex(index);

new Select(driver.findElement(By.name("country"))).selectByValue(value);










Share this article

0 comments:

Post a Comment

 
Copyright © 2014 SeleniumCS • All Rights Reserved.
Template Design and • Powered by chakrapani.bayyana
back to top