Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. Select dropdown = new Select(driver.findElement(By.id("select2-operative_id-container")));
  2. dropdown.selectByVisibleText("Administrator");
  3.  
  4. This is select drop down.
  5.  
  6. Select dropdown = new Select(driver.findElement(By.xpath("put here xpath")));
  7. dropdown.selectByValue("A");
  8.  
  9. For bootstrap dropdown
  10. # you have to first click on the arrow icon(v) of the drop down.
  11. driver.findElement(By.xpath("put here xpath of the v icon")).click();
  12. # Then find the xpath of the value which you have to select from drop down and then apply click operation on it.
  13. driver.findElement(By.xpath("put here xpath of the value within drop down")).click();
  14.  
  15. Select dropdown = new Select(driver.findElement(By.id("select2-operative_id-container")));
  16.  
  17. dropdown.selectByValue("Administrator");
  18.  
  19. WebElement dropdown = new WebElement(driver.findElement(By.id("select2-operative_id-container")));
  20. dropdown.sendKeys("Administrator");
  21.  
  22. Select oSelect = new Select(driver.findElement(By.id("select2-operative_id-container")));
  23. oSelect.selectByValue(<your value>);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement