This method only works with browser-based web documents.

Bug reports.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

This method only works with browser-based web documents.

Post by omayer » Fri May 18, 2012 8:37 pm

I get this error intermittenlty -
"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");
				    
				}  	
Tipu

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: This method only works with browser-based web documents.

Post by sdaly » Mon May 21, 2012 7:59 am


omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: This method only works with browser-based web documents.

Post by omayer » Mon May 21, 2012 2:33 pm

Thank you sdaly for sharing the code.
-Somayer
Tipu