boolean check=true;
while(check)
{
try {
placeDistanceHotels.getAttribute(“visible”).equals(“true”);
topHotelsHeader.isDisplayed();
check=false;
}catch(Exception e)
{
comlib.swipe_ins(driver, “up”);
}
}
comlib.validateForElementDisplayed(placeDistanceHotels, driver, extest, “verify if Top Hotels is displayed”, “”,
“”, “Top Hotels is not displayed”);
public boolean validateForElementDisplayed(WebElement element,AppiumDriver driver,ExtentTest test, String stepDesc, String inputValue, String expectedValue, String actValue) throws Exception
{
boolean check=false;
try{
Wait fw= new FluentWait(driver).withTimeout(20,TimeUnit.SECONDS).pollingEvery(2,TimeUnit.SECONDS).ignoring(Exception.class);
fw.until(ExpectedConditions.visibilityOf(element));
passNew(stepDesc, inputValue, expectedValue, test);
check=true;
}
catch (Exception e) {
check= false;
System.out.println(stepDesc+"fail");
failNew(driver, stepDesc, inputValue, actValue, test);
}
return check;
}