but what happen in appium it does not go to else statement rather stays on if statement and try finding element whic is nnot available on screen
pls provide a solution ASAP!
driver.findElement() will return an “Unable to find element” exception if it can’t find an element, which halts the test instantly.
We are using an isExist() method that tries to find an element and suppresses the catched “Unable to find element” exception, and simply returns false.
It’s really up to the organization you want to give to your code, you should build your own abstract functions to see if an element is present or not.
It is not possible to use try and catch for every element , so there should be an another solution if element is not found in the specified time then it should jump to the next element.
I did’nt get it
I need a solution for below line means how should we achieve it
how should element be skipped to nxt element if not available on screen @Sukant
You have two solutions above… using try - catch and arrays. Both work. You can find your own solution, this as little to do with automation tool, its pure code problem.
Also make sure you are using latests appium version (1.7.1) and java client (5.0.4)