Open Browser Duration always zero (0) : Automation Tools

Open Browser Duration always zero (0)

Ranorex Spy, Recorder, and Studio.

Open Browser Duration always zero (0)

Postby JoshuaPereyda » Wed Mar 30, 2011 9: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.
JoshuaPereyda
 
Posts: 7
Joined: Wed Mar 23, 2011 2:20 am

Re: Open Browser Duration always zero (0)

Postby Ciege » Wed Mar 30, 2011 9: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...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Open Browser Duration always zero (0)

Postby JoshuaPereyda » Wed Mar 30, 2011 9: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".
JoshuaPereyda
 
Posts: 7
Joined: Wed Mar 23, 2011 2:20 am

Re: Open Browser Duration always zero (0)

Postby Ciege » Wed Mar 30, 2011 10: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...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Open Browser Duration always zero (0)

Postby JoshuaPereyda » Wed Mar 30, 2011 11: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.
JoshuaPereyda
 
Posts: 7
Joined: Wed Mar 23, 2011 2:20 am

Re: Open Browser Duration always zero (0)

Postby Ciege » Wed Mar 30, 2011 11: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-guide-20/visual-studio-integration.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
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Open Browser Duration always zero (0)

Postby Support Team » Wed Mar 30, 2011 11: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Open Browser Duration always zero (0)

Postby JoshuaPereyda » Wed Mar 30, 2011 11:52 pm

The file itself tells me that such changes will be overwritten.
JoshuaPereyda
 
Posts: 7
Joined: Wed Mar 23, 2011 2:20 am

Re: Open Browser Duration always zero (0)

Postby Support Team » Thu Mar 31, 2011 10: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Open Browser Duration always zero (0)

Postby JoshuaPereyda » Thu Mar 31, 2011 5: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.
JoshuaPereyda
 
Posts: 7
Joined: Wed Mar 23, 2011 2:20 am


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests