how to iterate list in java selenium
Iterator<WebElement> itr = allLinks.iterator();
while(itr.hasNext()) {
System.out.println(itr.next().getText());
}
how to iterate list in java selenium
Iterator<WebElement> itr = allLinks.iterator();
while(itr.hasNext()) {
System.out.println(itr.next().getText());
}
how to iterate list in java selenium
Iterator<WebElement> itr = allLinks.iterator();
while(itr.hasNext()) {
System.out.println(itr.next().getText());
}
how to iterate list in java selenium
public Boolean selectByText( String text ) {
WebElement dropDown = driver.findElement( By.xpath( ".//dropdown/path" ) );
dropDown.click();
List<WebElement> allOptions = dropDown.findElements(By.xpath(".//option"));
for ( WebElement we: allOptions) {
dropDown.sendKeys( Keys.DOWN ); //simulate visual movement
sleep(250);
if ( we.getText().contains( text ) ) select.selectByVisibleText("Value1");
}
}
how to iterate list in java selenium
public Boolean selectByText( String text ) {
WebElement dropDown = driver.findElement( By.xpath( ".//dropdown/path" ) );
dropDown.click();
List<WebElement> allOptions = dropDown.findElements(By.xpath(".//option"));
for ( WebElement we: allOptions) {
dropDown.sendKeys( Keys.DOWN ); //simulate visual movement
sleep(250);
if ( we.getText().contains( text ) ) select.selectByVisibleText("Value1");
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us