SHARE
TWEET

Untitled

a guest Jun 27th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top