How to rerun same test before going to next iteration

Ranorex Studio, Spy, Recorder, and Driver.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

How to rerun same test before going to next iteration

Post by omayer » Fri Sep 13, 2013 4:24 pm

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




Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Mon Sep 23, 2013 4:08 pm

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

Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

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

Post by Mayra » Tue May 06, 2014 2:22 am

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.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Tue May 06, 2014 2:04 pm

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.
Shortcuts usually aren't...

Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

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

Post by Mayra » Wed May 07, 2014 12:14 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri May 09, 2014 2:45 pm

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

sabbir01
Posts: 1
Joined: Thu May 22, 2014 9:25 pm

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

Post by sabbir01 » Thu May 22, 2014 9:30 pm

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,