"Action 'close' failed on element '{WebDocument:Create Candidate Activity}'. This method only works with browser-based web documents. "
Here is the code i am using --
Code: Select all
public void CloseActivityScreen()
{
Delay.Ms(4000);
bool found = false;
WebDocument webDocument ="/dom[@caption='Create Candidate Activity']";
InputTag findNextActivityButton;
found = webDocument.TryFindSingle("/dom[@caption='Create Candidate Activity']//input[@id='nextActivity']", 30000, out findNextActivityButton);
if (!found)
{
throw new Ranorex.ElementNotFoundException("Create Candidate Activity not visible", null);
}
else
{
webDocument.EnsureVisible();
webDocument.Focus();
Delay.Ms(3000);
webDocument.Close();
Validate.NotExists("/dom[@caption='Create Candidate Activity' and @page='index.cfm']",10000,"Closed ActivityScreen");
}