How to make Ranorex touch button until another element exist
Posted: Mon Oct 09, 2017 8:49 am
Hi,
I need to set if else condition to find BTN_Controller on the screen. If it is not on the screen, user should touch the BTN_SearchNetwork to make another searching and than again check the page if there is our Controller. Maybe you would have to do it few times, until you find the right Controller (because Controller checks with network in intervals and it is possible that for half a minute it wouldn't be visible for search utility).
I have this code, but it's not working, in fact it's not doing anything.
Can you help me with this please? I am not programmer and I am learning C# only for Ranorex.
I need to set if else condition to find BTN_Controller on the screen. If it is not on the screen, user should touch the BTN_SearchNetwork to make another searching and than again check the page if there is our Controller. Maybe you would have to do it few times, until you find the right Controller (because Controller checks with network in intervals and it is possible that for half a minute it wouldn't be visible for search utility).
I have this code, but it's not working, in fact it's not doing anything.
Code: Select all
public void FindController()
{
var bTN_SearchNetwork = repo.WMA_WiserSmartAndroid.Index.InstallerLoginSteps.ChooseController.BTN_SearchNetwork;
var bTN_ControllerInfo = repo.WMA_WiserSmartAndroid.Index.InstallerLoginSteps.ChooseController.BTN_ControllerInfo;
var bTN_Controller = repo.WMA_WiserSmartAndroid.Index.InstallerLoginSteps.ChooseController.BTN_Controller;
if (bTN_ControllerInfo.Exists() == true)
bTN_Controller.EnsureVisible();
else bTN_SearchNetwork.Touch();
}