sak
14 years agoOccasional Contributor
Unable to find the object
Depending on whether or not a user has previously logged in to a remote website's application, either of 2 web objects will be present. I want to determine whether or not the user was already logged in so I can do different testing. Below is the code that I tried to use, looking for one of the 2 possible web objects:
if (Sys.Process("iexplore", 2).Page("https://192.168.1.100/abc/defg/login.do?action=secure").Frame("navigation").Exists)
{
Log.Event("new login");
}
else
{
Log.Event("existing login");
}
If the "navigation" frame does not exist, I receive an error [Unable to find the object Frame("navigation")]. How should I be testing for something that may or may not exist? I've tried WaitFrame, but that also generates an error message. It seems like this is something simple that testers would want to do. What am I missing here? Any help greatly appreciated - thank you!
if (Sys.Process("iexplore", 2).Page("https://192.168.1.100/abc/defg/login.do?action=secure").Frame("navigation").Exists)
{
Log.Event("new login");
}
else
{
Log.Event("existing login");
}
If the "navigation" frame does not exist, I receive an error [Unable to find the object Frame("navigation")]. How should I be testing for something that may or may not exist? I've tried WaitFrame, but that also generates an error message. It seems like this is something simple that testers would want to do. What am I missing here? Any help greatly appreciated - thank you!