Handling Inconsistent popups
I am writing a script test that performs a login using Apple ID. In the app the user selects 'login with Apple Id' then they are brought to Apple's login browser which pops up over the app. This is all expected.
The issue is that sometimes This browser does not load and a system notification is shown stating 'The app did not load correctly'. This is an Android specific popup that was not implemented by my tested app.
I am able to incorporate logic that if this popup is on screen then it will click 'continue' and go about as expected. My issue is when this popup does not occur, my script will present an error saying the popup is not found then continue with the logic as expected. I am using the .Visible, .VisibleOnScreen, and .Exists attributes but they still all run causing the attached error.
I can see in the logs that either way the script continues and in the end will output correctly. But since sometimes the popup does not occur, the if check is ran and produces an error causing the executed script to error. Is there any way to handle a sometimes occurring element without producing any errors in the logs?
if (obj.Wait().Exists)
{
// Some code
}
I found this in the documentation listed below. The difference with this and the example you showed is the Wait element instead of the Find element! Thank you for your help Alex.
https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/checking-existence.html