Appium Script Stops After Running Multiple Tests under Loop

Hi All,

I have Created a script where i have to run 4 functions under a loop. But Problem is that the script stops in the midway itself.

eg:-

for(i=0;i<100;i++)
{
F();
S();
T();
Q();
}

The Script works for some time like it runs loops for 6-7 times. and suddenly stops . giving error message as “Element not Found”.

Is there any better approach to do ths same(How to handle Multiple loops in appium)

Apparently it is stopping because one element was not found and nothing to do with being in a loop.

Are you using waits when finding elements?

Hi Telmon,
Ya But my ques is … if i able to run script for 5-6 loops .Then y it showing me error after executing loop for longer time.

Some particular view starts taking some ms longer to be presented p.e.