I heave problem with my code, how break the while loop ? the last if doesnt work. How check the window1 is not visible ? I want something like this:
1.Try do something
2.If 1. does not work and window1 is visible (this window can be more than 1) close all window1
3.If window1 is not visible break the loop
My code work almost well,If try is ok they dont do catch, if try not workink do catch, close all window1 but it still search window1,it does not end the while loop and throws an error in report
Code: Select all
try
{
Ranorex.Report.Info("First try do something");
}
catch
{
while (repo.window.window1.Self.Visible)
{
Ranorex.Report.Info("second");
repo.window.window1.Self.Close();
if(repo.window.window1.Self.Visible == false)
{
break;
}