MrDysprosium
8 years agoContributor
Checking if an object exists causes an error if the object does not exist. Is there a work around?
if Sys.Process("SWSetup-" + Project.Variables.versionNumber, 2).Window("#32770", "Setup", 1).WaitWindow("Button", "OK", 1, 120000).Exists: Sys.Process("SWSetup-" + Project.Variables.versionNumber, 2).Window("#32770", "Setup", 1).Window("Button", "OK", 1).Click() else: Log.Message("TEST")
Here's a snippet of code... the window I'm checking only exists under certain circumstances. So, if that window exists, I need to do something slightly different.
I find it kind of ridiculous that TC just fails the project if this check fails. Shouldn't it just continue to the "else"? Even if I wrap this in a try/catch, TC still fails the project if that window doesn't exist.
Is there a work around? I certainly hope so!