Code: Select all
internal void CheckSomethingImportantExists()
{
if(Ranorex_Automation_Helpers.Ranorex_Automation_HelpersRepository.Instance.MySpecialStructure.CloseButtonInfo.Exists(Duration.ToMilliseconds(10000)))
{
Ranorex_Automation_Helpers.Ranorex_Automation_HelpersRepository.Instance.MySpecialStructure.CloseButton.Click();
}
}
The second coding snippet checks something other with importance but in a different way:
Code: Select all
public void CloseXPanelIfUnexpectedlyOpen()
{
if (Validate.NotExists("/form[@title='foo' and @processname='UIprocess']//button[@automationid='CloseMessageDialog']",25002,"Check if msg panel is unexpectedly open ...",false))
{
//As expected.
Ranorex.Report.Info ("Ok. No x panel was unexpectedly open. Nothing to do. ");
}
else
{repoName.MyElementInRepositoy.MyNameOfButton.Click();
Ranorex.Report.Info ("X panel was unexpectedly open! Have closed this!");
}// end else
}
Thanks for any feed back.
With best regards
_KK_