Page 1 of 1

How to rerun same test before going to next iteration

Posted: Fri Sep 13, 2013 4:24 pm
by omayer
Hi, How to rerun same testcase when its failed before going to the next Iteration, thank you in advance

Code: Select all

void ITestModule.Run()

       			
 {
           		 Mouse.DefaultMoveTime = 300;
           		 Keyboard.DefaultKeyPressTime = 100;
           		 Delay.SpeedFactor = 1.0;
Found:
            			try{
            	
					///select which browser to run
					startBrowser = new ProcessStartInfo(BrowserInfo); 					
					startBrowser.WindowStyle = ProcessWindowStyle.Maximized;
					startBrowser.Arguments = EnvUrl;
					Report.Info(BrowserInfo);
					///Launch the Browser
					Process.Start(startBrowser);
					
					
					///login page
					WebDocument loginPage = "/dom[@caption='Login' and @page='Login.aspx' and @path='/Login.aspx' ]";
					
					///Login  the correct user name and password.
					GenericStaticClass.EnterTextIntoInputTag(loginPage.FindSingle(".//input[#'ctl00_ContentPlaceHolder1_txt']",30000),LogInId,"Enterred LoginId :");




}//try close
        
				

				catch(RanorexException excep){	
		
					///Cleanup    			    
					Report.Failure(excep.ToString());
					
					
					///Close open browser
					string[]browserName = BrowserInfo.Split('.');
					string firstWord = browserName[0]; 
					GenericStaticClass.CloseThreeBrowser(firstWord,": Browser Close");


					for (i = 0; i < 1; i++)
			     		{
			          		
						goto Found:
///i am in endlessloop
			     		}			 	
	      		 }//Catch Close





Re: How to rerun same test before going to next iteration

Posted: Mon Sep 23, 2013 4:08 pm
by Support Team
Hi,

Can you please describe in detail why you want to rerun the test when it fails?
What leads to the failed test case, maybe this can be handled in another way?

Regards,
Markus

Re: How to rerun same test before going to next iteration

Posted: Tue May 06, 2014 2:22 am
by Mayra
I also asked today about this functionality to the tech rep. I am having issues were elements that exist are not found, this happens inconsistently and at the very least, a workaround would be to be able to pass the test case on first run only if it passes, if it fails then give it a second run and then log the result.

Re: How to rerun same test before going to next iteration

Posted: Tue May 06, 2014 2:04 pm
by krstcs
If your test is failing when it should pass, you probably have an issue with the test (timing, XPath error, etc.). Covering that issue up like this will only make it worse in the long run. We should work on fixing the underlying problem.


I would recommend that you carefully study why the objects are not being found.

Maybe they aren't fully loaded sometimes when you try to interact with them? Have you tried adding Validate.Exists() before attempting to perform actions on the objects?

Maybe the path changes slightly (are you using indexes perhaps?)?

Remember that computers must be told EXACTLY what to do, when to do it, and what to do it to. That includes waiting for elements to load, especially with web pages. We humans tend to overlook those things because we are used to waiting on things or identifying things, and we don't think about the computer not knowing to wait or how to ID something without us telling it.

Re: How to rerun same test before going to next iteration

Posted: Wed May 07, 2014 12:14 am
by Mayra
I am already working with a rep. Items found by the spy are not found during execution. I have tons of delays, waits, etc. Of course, this would be a workaround for now, nevertheless more than one person has asked for this enhancement for different purposes. It is easy to do with other tools, I am not sure if this is possible with Ranorex.

Re: How to rerun same test before going to next iteration

Posted: Fri May 09, 2014 2:45 pm
by Support Team
Hello Mayra,

It's currently not possible to re-run failed test cases.

In order to raise and discuss your feature request may I ask you to send it to [email protected]? We want to handle feature request via Email since we want to avoid misunderstandings and want to handle each feature request with care.

Regards,
Robert

Re: How to rerun same test before going to next iteration

Posted: Thu May 22, 2014 9:30 pm
by sabbir01
Hi, Can you guys rerun the same test before going to next iteration in Desktop Application?

I need help with learning this tool. Can you guys recommend me anything that will help me to learn this tool as fast as possible ? Thank you,