Forum Discussion
Deborah,
Perhaps, the problem occurs because some parent object of the checked object does not exist. Look at the error message in the test log, in the Additional Information panel. It should say which object was not found. Make sure that the object is on the screen and check the object's mapping settings. Perhaps, they need to be corrected. You can click the "More Info" link in the Additional Information panel to learn more about the error you faced.
Instead my test just stops when the object does not exist
When TestComplete fails to find an object, it posts an error message to the test log. Most likely, you have the Stop on error property enabled in your project. In this case, TestComplete stops the test when an error message is logged. If you don't want your test to stop, disable the property. To do this, right-click your project in the Project Explorer and select Edit | Properties from the context menu. This will invoke the project editor and activate its Properties page. Select Playback from the tree on the left of the page. The setting will be on the right.
- jferreira8 years agoOccasional Contributor
I'm having the same kind of trouble with this "If Object Exists" test action on keyword tests too.
During testing, depending on certain previous conditions, I may or may not get a windows message asking if you want to proceed. If the message pops up, I want to click yes and proceed with the test; if the message doesn't pop up, I just proceed as expected.
So, I put up a "If Object Exists" check for the message box...
It's working fine when the message box pops up, but if it doesn't show up, the test just stops and logs a "The test execution was interrupted." message.On the Additional Info tab I get the following message:
"Possible reasons:
- An error or warning occurred during the test run. See the preceding log entries to locate and identify the error.
- The test run was stopped manually.
- The test run was terminated as a result of the Runner.Halt method call. "I don't want to disable the stop on error option. The whole point of using the "If Object Exists" check is precisely to avoid getting a unexpected object error.Any ideas on what I may be missing?Thanks.- Colin_McCrae8 years agoCommunity Hero
As per response from AlexeyK above, are you sure you mapped the top level item of the message box popup?
Because if you haven't it will fail due to stop on error if the parent of the message box is missing.
Whats the error you're getting? You told us what happens, but you didn't say what the actual error message said or where it pointed to?
- jferreira8 years agoOccasional Contributor
Yes, I think I have mapped the top level item of the message box popup correctly.
The message entry on the Test log is "The test execution was interrupted.".
It seems that Test Complete just keeps waiting for the message window to pop up until the time runs out and then halts execution.
Anyway, I've now found a workaround it:
I've added a code snippet with the Find method to check if the process child window message exists
[ TestObj.Find(PropNames, PropValues, Depth, Refresh).Exists ]
and then use the If...Then statement to check the Last Operation Result. It works.
Thank you for your reply.