| || |
Time out to find objects
i wish i will have a reply this time.
I'm using the find method to find my objects dynamically.
In order to have enough time for the "find" to find those objects i put it into a while buckle
(object==null || object.lengh==0)
the problem that if the object is not find it still seaching infinatly.
How to fix a time out?
i've used the help>prefrences>playback..., and i've modified default values and put big ones but it doesn't work correctly, the object exists but the script ends quickly espatially that the page i'm testing takes a long time to be loaded.
Re: Time out to find objects
Hey foufa, you can try this, let me know if it helps.
double timer = 0;
double timeOut = 60;
double timeBetweenChecks = 1;
while(timer < timeOut)
RootTestObject root = getRootTestObject();
TestObject objects = root.find(atDescendant(".id", objID, ".class", "Html.SPAN"));
if (objects.length != 0)
return new GuiTestObject (objects);
timer = timer + timeBetweenChecks;
throw new ObjectNotFoundException("Could not find object within " + timeOut + " seconds");
catch (RationalTestException rte )
logWarning("Rational Exception: " + rte.toString());