Popup screen
Posted: Fri Aug 12, 2011 5:13 pm
Cann't find the Ok bttn on popup screen using the following code, popup at 3r layer and triggers by enterring invalid data , .... Main page > Form > popup. ...any Suggestion please
Thanks,
Beginner
Code: Select all
bool exists = Validate.Exists(repo.ErrorPopUp.ButtonOKInfo, "popup Email Alert'{0}'",false);
if(exists)
{
// Identify the webdocument by its title
WebDocument webDocument = "/Container[@caption='Very quick check ']";
//find the ok bttn on dialogue
Ranorex.Button button = webDocument.FindSingle("/form[@title='Message from webpage']/button[@text='OK']");
//send screenshot to report
Report.Screenshot("/form[@title='Message from webpage']" + "email validation pass");
//click ok on popup
button.Click();
}
Beginner