enabling turbo for ranorex libraries

Ask general questions here.
neeshpal
Posts: 7
Joined: Tue Jun 11, 2019 6:29 pm

enabling turbo for ranorex libraries

Post by neeshpal » Mon Aug 12, 2019 8:25 pm

Hello
I am having issues with clicks on VM . There are no errors j, just that Click command executes but actual click does not happen and so ranorex is unable to find following element. I am using ranorex libraries and not ranorex studio. I have seen that In ranorex forums , support is suggesting to try turbo mode. How ever, I could not find how to enable turbo mode, if we are only using ranorex libraries.
- How can I enable turbo in this scenario?
- And if there's any other suggestion to deal with clicks on VM ?

Thank You

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5071
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: enabling turbo for ranorex libraries

Post by odklizec » Tue Aug 13, 2019 10:03 am

Hi,

The Turbo mode is just a mode, with some eliminated delays. It should be enough to add these lines at start of your code modules:

Code: Select all

            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 20;
            Delay.SpeedFactor = 0.00;
Default values (with disabled Turbo mode):

Code: Select all

            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.00;
Generally speaking, Ranorex does not encourage people to use this mode, because it could lead to some unwanted side effects. On the other hand, I found it useful especially on VMs, where it really helps with strange mouse movements and missclicks. But use it with caution ;)
Last edited by odklizec on Tue Aug 13, 2019 11:10 am, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Stub
Posts: 266
Joined: Fri Jul 15, 2016 1:35 pm

Re: enabling turbo for ranorex libraries

Post by Stub » Tue Aug 13, 2019 11:07 am

I've got our code modules setup to use Turbo mode on our test machine, and non-Turbo mode on other machines. We do have a few modules that are speed sensitive so I just slow them down to normal speed on a case-by-case basis. Turbo mode works good for us! Shaves off a stack of testing time too.

neeshpal
Posts: 7
Joined: Tue Jun 11, 2019 6:29 pm

Re: enabling turbo for ranorex libraries

Post by neeshpal » Tue Aug 13, 2019 7:15 pm

Thank You. This seems to have worked and tests are stabilized to some extent. Is there a way to switch off turbo mode for some clicks ?
Is it simply, updating property values as in disabled mode just before the click and expect it to work normal (without turbo)?

odklizec wrote:
Tue Aug 13, 2019 10:03 am
Hi,

The Turbo mode is just a mode, with some eliminated delays. It should be enough to add these lines at start of your code modules:

Code: Select all

            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 20;
            Delay.SpeedFactor = 0.00;
Default values (with disabled Turbo mode):

Code: Select all

            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.00;
Generally speaking, Ranorex does not encourage people to use this mode, because it could lead to some unwanted side effects. On the other hand, I found it useful especially on VMs, where it really helps with strange mouse movements and missclicks. But use it with caution ;)

User avatar
Vega
Posts: 161
Joined: Mon Jul 11, 2016 2:15 pm

Re: enabling turbo for ranorex libraries

Post by Vega » Thu Aug 15, 2019 7:51 pm

neeshpal wrote:
Tue Aug 13, 2019 7:15 pm
Thank You. This seems to have worked and tests are stabilized to some extent. Is there a way to switch off turbo mode for some clicks ?
Is it simply, updating property values as in disabled mode just before the click and expect it to work normal (without turbo)?

odklizec wrote:
Tue Aug 13, 2019 10:03 am
Hi,

The Turbo mode is just a mode, with some eliminated delays. It should be enough to add these lines at start of your code modules:

Code: Select all

            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 20;
            Delay.SpeedFactor = 0.00;
Default values (with disabled Turbo mode):

Code: Select all

            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.00;
Generally speaking, Ranorex does not encourage people to use this mode, because it could lead to some unwanted side effects. On the other hand, I found it useful especially on VMs, where it really helps with strange mouse movements and missclicks. But use it with caution ;)
yes you can update the speed any time to make the adjustment. Just giving it a try I adjusted the speed mid-module and it took effect immediately. There are better ways to structure this but here is the basic example of how I tested it:

Code: Select all

        void ITestModule.Run()
        {
        //normal speed
            Mouse.DefaultMoveTime = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.0;
            
            //open browser
            Host.Current.OpenBrowser("http://www.ranorex.com", "IE", "", false, false, false, false, false, true);
            Delay.Milliseconds(0);
            
            //loop some mouse actions
            for (int i = 1; i < 5; i++)
            {
            	dosteps();
            }
            
            //adjusted speed
            Report.Info("SPEED TIME!");
            Mouse.DefaultMoveTime = 0;
            Keyboard.DefaultKeyPressTime = 20;
            Delay.SpeedFactor = 0;
            
            //loop some mouse actions
             for (int i = 1; i < 5; i++)
            {
            	dosteps();
            }
        }
Hope this helps