Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
A general policy here on these forums is to try to keep questions as one per thread... just keep that in mind for next time... it makes it easier for folks to search for answers and such without having to sort through long threads...
in any case, What you've described is a common "problem". What it has to do with is what I call "timing issues". When you record something, there are certain points in the process of recording that you wait for a screen to come up before proceeding. However, the recording does not take that into consideration. So, when the scripts play back, there is a default "auto-wait" of 10 seconds that, if the particular object does not come up in sufficient time, it fails with your specific error. In other words, the scripts are playing back at a faster speed than the application under test is expecting.
There are a number of ways to get around this. The first is to increase that "auto-wait" time out (Tools | Current Project Properties | Playback) however that is, while more stable, still not a complete solution. Say your playback is on a slower machine than the one you are on now. The auto-wait time out may be fine for your machine but not for that other one.
You can hard code delays in your scripts by adding code for "Delay(nnnn)" where nnnn is a number of milliseconds to delay (10000 = 10 seconds). But this also is not very reliable for the same reason as above.
So, the ultimate solution is to use "WaitNNN" methods. These are special methods built in to TestComplete that will wait for an object up to a certain point and return that object if it appears within the timing, or returns an empty object.
To start reading on this, check out the following articles:
http://smartbear.com/support/viewarticle/14496/
http://smartbear.com/support/viewarticle/12168/
in any case, What you've described is a common "problem". What it has to do with is what I call "timing issues". When you record something, there are certain points in the process of recording that you wait for a screen to come up before proceeding. However, the recording does not take that into consideration. So, when the scripts play back, there is a default "auto-wait" of 10 seconds that, if the particular object does not come up in sufficient time, it fails with your specific error. In other words, the scripts are playing back at a faster speed than the application under test is expecting.
There are a number of ways to get around this. The first is to increase that "auto-wait" time out (Tools | Current Project Properties | Playback) however that is, while more stable, still not a complete solution. Say your playback is on a slower machine than the one you are on now. The auto-wait time out may be fine for your machine but not for that other one.
You can hard code delays in your scripts by adding code for "Delay(nnnn)" where nnnn is a number of milliseconds to delay (10000 = 10 seconds). But this also is not very reliable for the same reason as above.
So, the ultimate solution is to use "WaitNNN" methods. These are special methods built in to TestComplete that will wait for an object up to a certain point and return that object if it appears within the timing, or returns an empty object.
To start reading on this, check out the following articles:
http://smartbear.com/support/viewarticle/14496/
http://smartbear.com/support/viewarticle/12168/