Appium is kept retrying to find the webElement and not executing the else condition
See original GitHub issueThe problem
I have a condition where I have to click on one Web Element till the new element appears and then to come out of the loop But appium continues try to find the new element
Environment
- Appium 1.6.5 version
Details
Here is mine code
@FindBy(id="Some Id which Appium keeps on trying to find")
List<WebElement> SessionEnded;
BotButtonForChat.click();
while(BotButtonForChat.isDisplayed()){
int len =SessionEnded.size(); // it gets stucked at this point
System.out.println(len);
if(len>0){
break;
}
else{
wai8.until(ExpectedConditions.visibilityOf(BotButtonForChat));
BotButtonForChat.click();
}
}
I have used the Boolean also like Boolean isPresent = driver.findElements(By.id(“Some Id”)).size() > 0; if(isPresent.isDisplayed()){ do some action } else { Do some Action} I have also tried with Try catch logic
Link to Appium logs
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[RESOURCE_ID=“My Element Id”] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0) [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=com.edmobilelabs.betterplace.dev:id/tvCmdText] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
I have tried the same type of logic while using Selenium on automating webapps , It works every Time Is there some sort of Work Around Please explain the answer or some logic in java code
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
Please post the full logs as a link to a gist. Also, what is it that you are trying to do? The little bit of logs here is just not finding an element.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.