Forum Discussion
- Marsha_R
Champion Level 3
It will be something like this:
if (object name of pop up box.enabled) then button.click
Put it in the spot in the test where you would see the pop up if it happens. If the pop up happens, the click will happen. If it doesn't pop up, then the click won't happen. Either way you go on to the next line.
- SanderKOccasional Contributor
That method will only work if the object is disabled. If it isn't there altogether your example will try to read the Enabled property of a non-existing object resulting in an error.
What you want to do is first check if the object exists using the FindChild or Wait(Alias)Child method before attempting to use it.
Your code will be like this:
if(ParentObject.WaitAliasChild("ObjectName", 1000).Exists) { DoStuff(); }
This will always work since the method will return a dummy object with an Exists = false property if the object you're searching is not found.