Error log despite try... catch operation
Hi everybody,
maybe somebody can help me with my issue: Despite of using a try... catch... operation I get an error logged when the try operation fails:
try {
adobeReader.dlgPrint.cmbPrinter.ClickItem("Microsoft Print To PDF");
} catch (ex) {
adobeReader.dlgPrint.cmbPrinter.ClickItem("Amyuni PDF Suite");
}
The item "Microsoft Print To PDF" does not exist and so TC should select "Amyuni PDF Suite". It has worked previously; one thing I remember I have changed was to add an event handler for log warnings (not errors). Could it depend on this?
Thanks in advance 🙂
mattb wrote:Hi,
Myself personally I like to use if else statements to look if a object is visible on screen or not, and then continue.
If object is invisible refresh the browser code:function IfObjectInvisible()
{
if(!Project.Variables.PageObject.VisibleOnScreen){
Aliases.browser.Refresh() rapidfs account
}
else{
return true;
}
}
If Object is visible, continue, else refresh the browserfunction IfObjectVisible()
{
if(Project.Variables.PageObject.VisibleOnScreen){
return true;
}
else{
Aliases.browser.Refresh()
}
}
I dont know if its a great idea to add an event for ignoring errors. If you were going to, I would recommend adding that within the logic itself, not an event for every error.Thanks for the update. I'll be sure to keep an eye on this thread.