When you select the family Room, you get 2 drop downs : 1.Asking number of adults 2.Asking number of child Once you select a number from 2nd dropdown, a 3rd dropdown gets visible. For that i use explicit wait, but still it doesn't get selected don't know why?
@Test
public void familyRoomFeature() throws InterruptedException
{
//Selecting Family Room from the dropdown
driver.findElement(By.xpath(".//*[@id='js-fullscreen-hero']/div/form/div[2]/div/div/ul/li [3]/button")).click();
Thread.sleep(7000);
//Selecting Adult age & there is another dropdown where it asks how many kids a user would have
Select adultSelect=new Select(driver.findElement(By.xpath(".//*[@id='select-num-adults-1']")));
Select childSelect=new Select(driver.findElement(By.xpath(".//*[@id='select-num-children-1']")));
adultSelect.selectByIndex(2);
childSelect.selectByIndex(1);
//So once you select Adult & child selection, another selection dropdown gets visible
//I get an error here and it doesn't select the child's age inspite of explicit wait
WebElement childAge =driver.findElement(By.id("select-ages-children-1-78"));
WebElement childAgedrop = wait.until(ExpectedConditions.visibilityOf(childAge));
Select childAgeFromSelect = new Select(childAgedrop);
childAgeFromSelect.selectByIndex(3);
}
}
Aucun commentaire:
Enregistrer un commentaire