Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select dropdown = new Select(driver.findElement(By.id("select2-operative_id-container")));
- dropdown.selectByVisibleText("Administrator");
- This is select drop down.
- Select dropdown = new Select(driver.findElement(By.xpath("put here xpath")));
- dropdown.selectByValue("A");
- For bootstrap dropdown
- # you have to first click on the arrow icon(v) of the drop down.
- driver.findElement(By.xpath("put here xpath of the v icon")).click();
- # Then find the xpath of the value which you have to select from drop down and then apply click operation on it.
- driver.findElement(By.xpath("put here xpath of the value within drop down")).click();
- Select dropdown = new Select(driver.findElement(By.id("select2-operative_id-container")));
- dropdown.selectByValue("Administrator");
- WebElement dropdown = new WebElement(driver.findElement(By.id("select2-operative_id-container")));
- dropdown.sendKeys("Administrator");
- Select oSelect = new Select(driver.findElement(By.id("select2-operative_id-container")));
- oSelect.selectByValue(<your value>);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement