It will have been higher in the event you had supplied extra data by way of what you had been making an attempt to do, whether or not you had been getting an error utilizing this location technique our had been making an attempt, logs, how lengthy it was taking and so forth. However primarily based on the knowledge you supplied let me share couple of the way I fastened timing points in my selenium script.
- Location Technique-
You will have quite a lot of time delays in the event you iterate by way of varied tags within the DOM to seek out and component. That is the rationale you might not need to use XPath or most likely the situation technique you are attempting to make use of. You might be higher off,
Step 1 – finding component by id and identify.
Step 2 – If Step 1 doesn’t work use class identify or tag names
Step 3 – If Step 2 doesn’t work you should use hyperlink textual content or partial textual content
Step 4 – For those who do not need some other possibility, I might nonetheless ask builders so as to add mandatory ids after which lastly might use Xpath as my worst and remaining possibility.
Because you making an attempt to do automation on the an android app, be default every component ought to have a “resource-id”. So, you need to have the ability to click on on any component by the id. You’d do one thing like
driver.find_element(:id, “thelemementid”).click on()
- Wait instances
How a lot wait time had been you giving to explicitly make the check wait until the component was positioned? I’m asking as a result of if the wait time is just too lengthy then there may very well be an error however you do not know it but because the check remains to be working ready for a component to seem.
- How the app is structured
I’ve had conditions the place a button structure overlaps with one other button and appium is unable to seek out the button beneath the structure. Due to this you’d by no means have the ability to click on on the button which is getting coated by one other button or web page on prime of it. So you might need to examine for the way the app structure is structured.
These are among the issues I’ve completed to troubleshoot comparable issues you’re presently dealing with.
-Raj
