Page 1 of 1

Timeouts while running batch file

Posted: Thu Oct 01, 2015 8:21 am
by Sajczi
Hello,

I have a problem while running my tests one after each other. I have like 30 tests, when they are runned individually they all pass, but when I put them into batch file and run by that, some of them fail (not the same each time, sometimes one test passes sometimes it doesn't) because they do not find elements in my test desktop application (I believe the reason are timeouts). Is there any simple way to fix this? Is it PC's fault? I've added many delays to make sure PC has time to process everything but errors still occur.

Re: Timeouts while running batch file

Posted: Thu Oct 01, 2015 8:48 am
by odklizec
Hi,

Unfortunately, without more details about your system and application under test, Ranorex version, your actual Ranorex tests and exact errors you are getting, is almost impossible to say what's wrong. My guess is that your tests are not robust enough and could fail if this or that bit of GUI loads slower than expected by your test.

Using simple delays is definitely no way to go. Not only they make your test unnecessary slow, but additionally, none delay is long enough ;) It's much better to use WaitFor Exists/NotExists method. You should use this method at places you consider problematic parts of your tests. Typically, you should use it at places where it takes some time to load entire GUI (start with replacing all hardcoded delays). In such cases, you should always wait for the appearance/disappearance of a problematic element. And this is exactly what the WaitFor method does. Hope this helps?