Forum Discussion
Thanks tristaanogre , I don't know why sometimes a test failed at the first round and if I rerun it would pass at the second round without making any change to the code. I have seen a lot of people here had this issue. Maybe it was the performance issue of the virtual machine? what happens the most is object cannot be found, but from the error screenshot I can clearly see that the object is on the page, and I did wait for the page to load. So if a rerun can solve the problem, I hope to get it run by itself ideally.
That's still an indication that something needs to be corrected in the automation. This is what we "lovingly" refer to here on the community as "timing" issues. It takes time, sometimes, for an object to appear. And the automation tries to run as fast as possible unless told to wait or detect or find. An even if you have those detections and waits in place, they may not be set to wait long enough. So, while it's an intermittent problem, it's still one that needs to be resolved. A rerun did not "fix" the problem, just you happened to run it in a situation where the application is not under as heavy a load, where the timing worked out better, etc. So, you rerun it today and it works... tomorrow it may fail again at the same point for the same reason. A failed test is a failed test. Fix the failure THEN re-run.
- whuang6 years agoRegular Contributor
Yes, I totally agree with you, but if it still reports object cannot be found after I told it to wait for the page to load, I really don't know how to fix the issue then. I try not to hardcode a time out if it is not absolutely necessary to avoid unnecessary waiting.
- tristaanogre6 years agoEsteemed Contributor
Agreed, hardcoding is not the way to do it. But, obviously, something is going on with the timing. It might be that the "Wait" you have set is still not long enough. The "Wait" method for a page has a parameter that you can set to wait for longer than the default time in your TestComplete settings. It could be that you need to increase that amount to wait longer for the page to load. Again, keep in mind that's a MAXIMUM wait. It won't always wait that amount so, as an experiment, you could make it some astronomically huge number (120000 milliseconds which is 2 minutes) and that will at least see if it fixes the problem. Then you can, at your leisure, tweak it down.
- tristaanogre6 years agoEsteemed Contributor
And, honestly, if it takes longer than 2 minutes for a page to load, even if it's intermittant, I'd write that up as a bug. User experience is key with web apps. I know that if i'm going to a website, I get really ticked off if it takes FOREVER for something to happen if I'm not given some sort of message like "please wait" or "Processing..." or something.
Related Content
- 4 years ago
- 10 years ago
- 5 years ago
Recent Discussions
- 15 hours ago