Guest User

Untitled

a guest
Oct 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. protected void selectElementByVisibleTextAndFielsetName(WebElement parentElement , String visibleText , String fieldsetName){
  2. try {
  3. WebElement element = parentElement.findElement(By.xpath(".//div/label[contains(.,'"+fieldsetName+"')]/../../div/div/select"));
  4. Select select = new Select(element);
  5. select.selectByVisibleText(visibleText);
  6. logger.info("Selected text is :" + visibleText);
  7. }catch (Exception e ){
  8. e.printStackTrace();
  9. takeScreenshot();
  10. logger.info("Screen shot has been taken !");
  11. }
  12. }
Add Comment
Please, Sign In to add comment