I'm trying to find an element on a screen of an iOS native app which is an overlay that displays these components:
- A label with text as "Advertisement"
- A button with text "skip ad"
- A container in the middle which displays a video advertisement for around 10 seconds
The moment this overlay is displayed, I try to find an element with text as "Advertisement" as a way to identify that I'm on the correct screen.
The behaviour of this overlay is that it closes the moment the video advertisement finishes playing. Video duration is of ~ 10 seconds.
My script is:
driver.findElement(MobileBy.AccessibilityID("Advertisement"))
What does the overlay look like?
What is the issue?
findElement (from Appium Desktop) command takes too long to respond back with results. This is the Appium console log:
If you notice the time it takes for the find element to finish execution is 16882 ms (16 seconds) which is almost the same amount of time the video takes to play and finish.
IMP: The element is found (after the video completes) when I try to find it manually using Appium Desktop, but never found when I run an automated script. It gives an impression that Appium's process/request somehow gets blocked while the video is playing and resumes only when the video finishes.
Has anyone faced such similar issues with screens displaying video advertisements?