frank_vanderstr
10 years agoContributor
Handling Object Not Found Errors via Exceptions
I am trying to add functionality to my test Automation that will be able to catch Object Not Found errors when they occur and execute a reset script of sorts that will help solve the issue.
Unfortunately the Try Catch blocks do not actually catch one of the most unfriendly errors in Automation.
I have tried creating an event handler for this, but I am having trouble understanding how it actually works, and it seems like a bulky and clumsy solution anyways.
Basically I am trying to find out if there is a way I can prevent the script from completely stopping when it cannot find a mapped object and for that error to be caught and some other code executed.
Here is an example of what I would like to do using javascript.
function TestPage(param1, param2) {
try {
var testobj = Aliases.MappedName
testobj.Click();
} catch(e)
Log.Message(e.description);
ResetFunction(e.description)a;
}
Unfortunately the Try Catch blocks do not actually catch one of the most unfriendly errors in Automation.
I have tried creating an event handler for this, but I am having trouble understanding how it actually works, and it seems like a bulky and clumsy solution anyways.
Basically I am trying to find out if there is a way I can prevent the script from completely stopping when it cannot find a mapped object and for that error to be caught and some other code executed.
Here is an example of what I would like to do using javascript.
function TestPage(param1, param2) {
try {
var testobj = Aliases.MappedName
testobj.Click();
} catch(e)
Log.Message(e.description);
ResetFunction(e.description)a;
}