vendredi 1 février 2019

Getting output problem gettext() selenium java

Select select5 = new Select(getDriver().findElement(By.id("qf-0q-room-0-child-0-age")));
    select5.selectByVisibleText("3");
    WebElement element6 = select5.getFirstSelectedOption();
    System.out.println("Kid age: " + element6.getText() );

    Select select6 = new Select(getDriver().findElement(By.id("qf-0q-room-0-child-1-age")));
    WebElement element4 = select6.getFirstSelectedOption();
    select6.selectByVisibleText("5");
    System.out.println(element4.getText());

What is the problem? I could not get output from second one. I want to get output Kid age: 3 and Kid age:5. I can get first one. But no second one. Thank you

Aucun commentaire:

Enregistrer un commentaire