Forum Discussion

adrian_g's avatar
adrian_g
Occasional Contributor
14 years ago

TestComplete's .Exists Function

Hi Guys,


I am used to Quick Test Pro so I am sometimes lost as to what to do in TestComplete.


I am familiar with doing the following:


If WebpageObject.exists Then

‘do something

Else

‘do something else

End If


QTP simply runs through this and if the object is not there it simply moves on to the else statement without pausing or logging an error.


The problem with TestComplete is that when the .Exists part fails, it logs and error to the log and in my case it pauses test execution (because I have “Pause test execution on posting an error” ticked).


I don’t want it to pause because it almost defeats the point of automation in that someone has to keep monitoring the script to see what is happening with it. I don’t want to remove the tick in “Pause test execution on posting an error” because instances where something fails badly the scripts keeps executing nonstop which is silly if the first screen returns a server error and keeps executing through many screens that aren’t there.


What solutions do I have with TestComplete to check if an object exists without pausing the script. This applies to web page objects and desktop applications e.g. .Net


Thanks,

Adrian

14 Replies