Horje
how to iterate list in java selenium Code Example
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
Iterator<WebElement> itr = allLinks.iterator();
while(itr.hasNext()) {
    System.out.println(itr.next().getText());
}




Java

Related
what is java.io example Code Example what is java.io example Code Example
poo pledin 3.0 Code Example poo pledin 3.0 Code Example
<?xml version="1.0" encoding="UTF-8"?> Code Example <?xml version="1.0" encoding="UTF-8"?> Code Example
site:stackoverflow.com List is abstract; cannot be instantiated public List<Integer> result = new List<>(); Code Example site:stackoverflow.com List is abstract; cannot be instantiated public List<Integer> result = new List<>(); Code Example
splash full screen android Code Example splash full screen android Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7