I find myself having to check whether elements are visible or no longer visible on a regular basis. To confirm whether pages and or popups have loaded or closed before continuing with further actions.
At the moment I am adding user code each time I need to do this during the test cases.
I am guessing there must be a more efficient way of achieving this? I saw one post where someone mentioned making a method to do this - I'm afraid I'm not a developer and cobble together my code using Google so am not sure how to implement this.
If anyone can help you will make my life a lot easier.
Many thanks
Ben
Code: Select all
public void Wait_For_Popup()
{
Report.Log(ReportLevel.Info, "Wait", "Waiting for item 'GroupcallMessengerRoot.Popup' to be visible.");
bool WindowVisible = repo.GroupcallMessengerRoot.Popup.Self.Visible;
while (repo.GroupcallMessengerRoot.Popup.Self.Visible == false)
{
Thread.Sleep(500);
WindowVisible = repo.GroupcallMessengerRoot.Popup.Self.Visible;
}
}
public void Mouse_Click_House()
{
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'GroupcallMessengerRoot.SendMessage.SideMenu.House' at Center.", repo.GroupcallMessengerRoot.SendMessage.SideMenu.HouseInfo);
if (repo.GroupcallMessengerRoot.SendMessage.SideMenu.House_Li1.Visible != true) {
repo.GroupcallMessengerRoot.SendMessage.SideMenu.House.Click();
}
}