how to change Ranorex Speed factor

Ask general questions here.
rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

how to change Ranorex Speed factor

Post by rajeswari » Mon Apr 03, 2017 3:23 pm

im using ranorex test-suite on an desktop application which creates / verifies data. And whenever a action is performed a notice for every action is triggered on the background. Now since the speed between my actions (mainly usercode) are fast, i get access violation error often. this error happens when ranorex tries to access the element when a notification is updating it .

hence i wanted to reduce the speed of the run. i had increased the ms in the testsuite-settings 1.mouse action, 2.keyboard press etc.. still when it comes to usercode the actions are fast and the errors are happening.
also currently the speed factor is different in each of the testcase.cs.

is there a way to update the speed factor(Delay.SpeedFactor = 0.00;) for whole testsuite manually. please help.

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

Re: how to change Ranorex Speed factor

Post by odklizec » Tue Apr 04, 2017 8:21 am

Hi,

As far as I know, the only thing, regarding the speed factor, that could be set globally is setting the factor for Find timeout operations, i.e. not Delays.

I think your main problem is not in the speed factor, but in the fact that the elements are accessed in "not-yet-ready" or "disabled" state? What you need to do is to replace Delays at all critical places with WaitFor Exists/NotExists method and simply wait for the appearance or disappearance of an element, which indicates the element in question is ready. Usage of Delays should be limited to a very few instances and only for non-critical things (e.g. in loops). It should not be used as an assurance the GUI element is in ready/available state.
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

rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

Re: how to change Ranorex Speed factor

Post by rajeswari » Tue Apr 04, 2017 10:08 am

hi odklizec,

Thanks for the response.
1. all the elements im accessing are inside forms, hence i wait for the form to appear and finish loading, then check the listitems/create/update which are visible, and active in window. These access voilation errors doesnt appear when the testing is done manually.
2. currently i have updated the speedfactor for each of the recording modules in the testsuite- through settings on recording module. (set to 0.80 from 1.0). hope this will help a bit.
3. There is automatic delay which was added between recording steps(delay.milliseconds(200) in program.cs). I wanted these between the usercode steps. the speedfactor takes care of these which is fine.

Thanks
Raj

McTurtle
Posts: 191
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: how to change Ranorex Speed factor

Post by McTurtle » Wed Apr 05, 2017 12:51 pm

Hello Raj,

Parameters like Delay.SpeedFactor get set right at the beginning of each recording module. I suggest the following:

1. Add a "User Code Collection" to your Project: http://www.ranorex.com/support/user-gui ... thods.html

2. Create a new "User Code Method" in which you set parameters like Delay.SpeedFactor. I suggest passing a parameter value from outside into the method

3. Add this "User Code Method" from the collection right at the beginning of each recording module

4. Bind the value that sets Delay.SpeedFactor via the parameter of the "User Code Method" with a Module Variable and further to a global parameter

You should now be able to set the Delay.SpeedFactor for your whole test suite by changing only one global parameter. Each recording module will still initially set some value for this, usually 1.00 or 0.00 depending on if Turbo Mode is disabled or enabled. But your User Code Method will override this before any actions are actually executed.

Please let me know if this helped. If you need further explanation of any part, just let us know.

Regards,
McTurtle

rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

Re: how to change Ranorex Speed factor

Post by rajeswari » Fri Apr 21, 2017 11:34 am

Hi McTurtle, Thanks for the suggestion on how to set global delay.speedfactor. Sorry the access violation i had on client still appears and the speed doesnt seem to be the reason(which i set thru recording module settings). i had several tries on changing the way forms and data are accessed, still no improvement. But thanks for the good solution, i will try this.

McTurtle
Posts: 191
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: how to change Ranorex Speed factor

Post by McTurtle » Fri Apr 21, 2017 11:52 am

Hello Raj,

Could you post a screenshot of the access violation error message?
I guess you are running the application and Ranorex with admin privileges?

Regards,
McTurtle

rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

Re: how to change Ranorex Speed factor

Post by rajeswari » Thu Jun 22, 2017 1:12 pm

Hi McTurtle,

The access violation occurs on the Client, not on the Ranorex report. I have asked for help from support, bu there is nothing in the logs/report to help.
Don't know what invokes the access violation on the client, happens mostly while automation test run is entering text in a field. And never happens when testing manually.
Attaching image, and sorry for late reply.

Thanks
Raj
Attachments
AA_AViolation1.JPG
AA_AViolation1.JPG (21.67 KiB) Viewed 660 times

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: how to change Ranorex Speed factor

Post by Vaughan.Douglas » Thu Jun 22, 2017 4:23 pm

I suspect that odklizec is correct. This is most likely a timing issue and you're going to need to find a way to make sure the UI is ready for interaction before proceeding. Another possibility is the method you're using to interact with the elements themselves.
Doug Vaughan