I need to check if an apps is present on the device screen (Android or iOS --> Home screen or second screen or third screen or ,). This need to be done while in “Recording” mode. The return would be TRUE or False (in boolResult per C# code in Visual Studio 2019). Also, regardless of the apps being found or not, the execution should be a passive PASS. With a Pass, the execution will move to the next instruction in the recording and not stop with a failure. At present I am trying to run the following instruction (created from TestProject Recording):
// 1. Is ‘Play Store2’ clickable?
by = By.XPath("//android.widget.TextView[@content-desc = ‘Play Store’]");
boolResult = driver.TestProject().IsClickable(by);
report.Step(“Is ‘Play Store2’ clickable?”, !(boolResult), TakeScreenshotConditionType.Never);
In this test step, there is no way to continue to the next step/instruction if the “PLAY STORE” apps is not found (CLICKABLE) on the current device screen (Android or iOS --> Home screen or second screen or third screen or ,). Perhaps, there is a different instruction/test step in Recording, that I can execute to get the TRUE or FALSE value in boolResult (to further use it in C# code in VS 2019) and I am not aware of it. There should be an entry in the test step in Recording, that will overwrite as a passive Pass, regardless of the test condition and the tester will be responsible for setting this condition. I hope I am making some sense and thanks for your help.