Pavithra,
Why not define your own ExpectedCondition implementation for this ?
public class MyCondition implements ExpectedCondition<Boolean>{
private By locator1, locator2;
public MyCondition(By locator1, By locator2){
this.locator1 = locator1;
this.locator2 = locator2;
}
@Override
public Boolean apply(WebDriver input) {
return input.findElement(this.locator1).isDisplayed() || input.findElement(this.locator2).isDisplayed();
}
}
Once you have such a class you can very well do :
By foo1 = By.name("name1");
By foo2 = By.id("id2");
new WebDriverWait(driver, 20).until(new MyCondition(foo1, foo2));
Would that help ?
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"