Timeouts while running batch file

Ask general questions here.
Posts: 9
Joined: Fri Jul 31, 2015 8:24 am

Timeouts while running batch file

Post by Sajczi » Thu Oct 01, 2015 8:21 am


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.

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Timeouts while running batch file

Post by odklizec » Thu Oct 01, 2015 8:48 am


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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration