简体   繁体   中英

How to Select Multiple dropdowns using selenium webdriver

Currently am working on selenium webdriver . I am trying select the multiple dropdowns and it is the filter selection. once i selected multiple dropdown i will click on Apply Filter button then i will produce the result based on the selected filter section. so i am getting problem to select multiple drop down and can't able to click on Apply filter dropdown. Could you please help me to figure out how to use the code. am using java

Here is my sample code:

driver.findElement(By.id("ext-new-prs")).click();
new Select(driver.findElement(By.id("visualizationId"))).selectByVisibleText("Center");
new Select(driver.findElement(By.id("periodId"))).selectByVisibleText("Last 52 Weeks");
new Select(driver.findElement(By.id("topographyId"))).selectByVisibleText("Center");
driver.findElement(By.cssSelector("#topographyId > option[value=\"center\"]")).click();
new Select(driver.findElement(By.id("centerId"))).selectByVisibleText("OAB");
new Select(driver.findElement(By.id("featureRequestId"))).selectByVisibleText("Include");
driver.findElement(By.id("kpiFilterSubmit")).click();

Something like below:-

Actions actions = new Actions(driver);
WebElement dBox1= (new WebDriverWait(driver,10)).until(ExpectedConditions.elementToBeClickable(By.id("visualizationId"))).selectByVisibleText("Center");
actions.moveToElement(dBox1);
actions.click();
actions.perform();
public static void waitforElement (WebDriver driver , int Seconds , String Locator )
{
WebDriverWait wait=new WebDriverWait(driver, Seconds);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(Locator)));
}
use this method
waitforElement(driver,30,"//div[@id='divGrid']");
call like this
By sundar
www.mjksundar.weebly.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM