Open Browser Duration always zero (0)

Ranorex Spy, Recorder, and Studio.
JoshuaPereyda
Posts: 7
Joined: Wed Mar 23, 2011 1:20 am

Open Browser Duration always zero (0)

Post by JoshuaPereyda » Wed Mar 30, 2011 8:15 pm

I have a test that opens IE to a website before testing certain site functionality. It seems that the Duration I set on the initial step doesn't actually affect the wait time.

If I set the first two steps to "10s", the test opens the browser and presses the first button right away, and then waits 10 seconds.

Am I missing something?

Turbo Mode is off. I've tested on both XP and Win7, with IE 7 and 8 respectively.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Open Browser Duration always zero (0)

Post by Ciege » Wed Mar 30, 2011 8:30 pm

Care to share you code for this so we can have a look at what you are doing?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

JoshuaPereyda
Posts: 7
Joined: Wed Mar 23, 2011 1:20 am

Re: Open Browser Duration always zero (0)

Post by JoshuaPereyda » Wed Mar 30, 2011 8:59 pm

Are you referring to the .cs file associated with the recording, or the whole project (or something else)?

Looking at the auto-generated code, I see part of the problem:

Code: Select all

		void ITestModule.Run()
		{
			Mouse.DefaultMoveTime = 300;
			Keyboard.DefaultKeyPressTime = 100;
			Delay.SpeedFactor = 1.0;

			Init();

			Report.Log(ReportLevel.Info, "Website", "Opening web site 'http://toc-dev.rl.gov/CostPlan?debug=false' with browser 'IE'", new RecordItemIndex(0));
			Host.Local.OpenBrowser("http://toc-dev.rl.gov/CostPlan?debug=false", "IE");
			
			Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocumentCostPlan.SomeTableTag1.TdTagBaseline' at 2;2.", repo.WebDocumentCostPlan.SomeTableTag1.TdTagBaselineInfo, new RecordItemIndex(1));
			repo.WebDocumentCostPlan.SomeTableTag1.TdTagBaseline.Click("2;2");
			Delay.Milliseconds(9700);
			
			Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'WebDocumentCostPlan.SomeTableTag1.SpanTagBL_Estimates' at 23;6.", repo.WebDocumentCostPlan.SomeTableTag1.SpanTagBL_EstimatesInfo, new RecordItemIndex(2));
			repo.WebDocumentCostPlan.SomeTableTag1.SpanTagBL_Estimates.Click("23;6");
			Delay.Milliseconds(1700);
It seems that there should be a Delay.Milliseconds(9700); after the Host.Local.OpenBrowser line.

I would upload a picture of the Designer, but my company blocks most image upload sites. I can assure you, however, that the Duration property does indeed read "10s".

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Open Browser Duration always zero (0)

Post by Ciege » Wed Mar 30, 2011 9:31 pm

OK, so you are using the record/playback methodology that Ranorex provides. Unfortunately, I don't use that, rather I do all my automation with my own user code.

I could help you out with the user code aspect of waiting for IE readystates, but I'll be of no help with record / playback.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

JoshuaPereyda
Posts: 7
Joined: Wed Mar 23, 2011 1:20 am

Re: Open Browser Duration always zero (0)

Post by JoshuaPereyda » Wed Mar 30, 2011 10:03 pm

Hmm... maybe I'll consider doing that as well. Now that I think about it, I've run into quite a few problems with the Recorder that would be easier to handle with my own code. Do you know of any simple starting guides for that sort of thing? I wasn't really aware that anybody used pure user code.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Open Browser Duration always zero (0)

Post by Ciege » Wed Mar 30, 2011 10:09 pm

Well it all depends on how comfortable you are with development (writing code).
You can use the Ranorex IDE to do you development in or (as I do) use Visual Studio to do your development. I use C# within VS.

Certainly check the user manual and search the forums as there are quite a few of us doing "pure code".

http://www.ranorex.com/support/user-gui ... ation.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Open Browser Duration always zero (0)

Post by Support Team » Wed Mar 30, 2011 10:38 pm

Hi,

the fact that the duration for opening the browser is not considered in code is a bug.

You could explicitly add a delay action, though.

Regards,
Roland
Ranorex Support Team
.
Image

JoshuaPereyda
Posts: 7
Joined: Wed Mar 23, 2011 1:20 am

Re: Open Browser Duration always zero (0)

Post by JoshuaPereyda » Wed Mar 30, 2011 10:52 pm

The file itself tells me that such changes will be overwritten.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Open Browser Duration always zero (0)

Post by Support Team » Thu Mar 31, 2011 9:20 am

Hi,

You cannot change the Recording source file, because this will be auto-generated by Ranorex. This hint is shown on the top of the file. To add a delay after the Open Browser Action, please use the Action Gird of the Recorder. There you will find a button called "Add New Action", just click on it and you will find the "Delay" item, where you can set your wait-time.
It is also highly recommended to use following documentation, if you start using Ranorex
http://www.ranorex.com/support/user-guide-20.html

Regards,
Peter
Ranorex Team
.
Image

JoshuaPereyda
Posts: 7
Joined: Wed Mar 23, 2011 1:20 am

Re: Open Browser Duration always zero (0)

Post by JoshuaPereyda » Thu Mar 31, 2011 4:44 pm

Thanks, I didn't know about the Delay item; it works perfectly. That's really helpful since I can use it in Turbo mode as well. Thanks!

I'll also plan to check out that user guide.

@Ciege Thanks for the link and the tip. I'll definitely consider that methodology as well. I haven't done any real C# programming in a while (almost a year), but I definitely enjoyed it when I did.