Synchronisation error problem

Ranorex Studio, Spy, Recorder, and Driver.
JimLin
Posts: 70
Joined: Mon Jun 02, 2014 4:23 pm

Synchronisation error problem

Post by JimLin » Mon Sep 01, 2014 1:54 pm

Hi,

I am having a synchronisation problem which I have not been able to find a solution to, either in these forums or in the wider world.

I have a button in the Object Repository which has a delay associated with it, as shown and highlighted below in the code from the recording module .cs file. My problem is that the delay is not long enough, causing my tests to fail, but I can't find where I can adjust it.

The 2200 milliseconds delay only appears in the recording module .cs code and I guess the duration is gathered during the initial recording process. I have looked in all the areas I can think of, like Global Settings and the button object itself, but can't find anything that matches the value.
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'Open*******Screen.Open*******ScreenBtn' at Center.", repo.Open*******Screen.Open*******ScreenBtnInfo, new RecordItemIndex(32));
repo.Open*******Screen.Open*******ScreenBtn.Click(300);
Delay.Milliseconds(2200);
I can add a delay action greater than 2200ms and the tests pass, but I am very keen to understand where the original delay comes from, just so I don't have surplus actions in my project.

Your thoughts would be greatly appreciated.

Cheers,
James

JimLin
Posts: 70
Joined: Mon Jun 02, 2014 4:23 pm

Re: Synchronisation error problem

Post by JimLin » Wed Sep 03, 2014 9:09 am

Hi,

Do Ranorex support have any thoughts on this?

Cheers,
James

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

Re: Synchronisation error problem

Post by Support Team » Thu Sep 04, 2014 12:27 pm

Hello James,

Unfortunately, there is no way to modify the automatically inserted delay since this is handled internally, BUT this delay just reflects the time gap between the “Duration” and the actual, e.g., “Move Time” of the action.

Let me clarify this by an example:

The “Mouse move time” is set to 300ms per default (Global Settings).
GlobalSettings_MouseMoveTime.png
If we add a mouse click action to our action table we get following properties:
MouseAction_Properties.png
The “Mouse move time” is 300ms and the “Duration” of the action is 500ms, that means Ranorex automatically creates a 200ms delay.
code_delay.png
Hope this information helps.

Regards,
Robert
You do not have the required permissions to view the files attached to this post.

JimLin
Posts: 70
Joined: Mon Jun 02, 2014 4:23 pm

Re: Synchronisation error problem

Post by JimLin » Thu Sep 04, 2014 1:21 pm

Thanks for the update. I think it makes sense to me.

Is 'Duration' then effectively the length of how long a user might click a button for?

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

Re: Synchronisation error problem

Post by krstcs » Thu Sep 04, 2014 2:08 pm

From my understanding, Duration is the length of the whole process. For instance:

For a duration of 500ms, clicking on a mouse button technically looks like this, at the system level:

1. Move mouse from current location to button (300ms MOVE TIME, i.e., Ranorex will take 300 ms to move the mouse from current location to the selected button)
2. Small delay (200ms delay)
3. Send mouse-click event (0ms)

For a total action duration of 500ms (1. 300ms + 2. 200ms + 3. 0ms).
Shortcuts usually aren't...

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

Re: Synchronisation error problem

Post by Support Team » Thu Sep 04, 2014 3:01 pm

Hello,

Thank you for your answer Kelly.

Unfortunately, you mixed up the 2nd and 3rd point.

1. Move mouse from current location to button (300ms MOVE TIME, i.e., Ranorex will take 300 ms to move the mouse from current location to the selected button)
2. Send mouse-click event (0ms)
3. Small delay (200ms delay)

That's the correct order. As you can see within the code snippet in my previous post, the "delay" is executed after the "MouseClick()" (which implies the "MouseMove").

Regards,
Robert

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

Re: Synchronisation error problem

Post by krstcs » Thu Sep 04, 2014 3:07 pm

Ah, great, thanks Robert! I missed your code example the first time. Helps if I read things fully! :oops:
Shortcuts usually aren't...

JimLin
Posts: 70
Joined: Mon Jun 02, 2014 4:23 pm

Re: Synchronisation error problem

Post by JimLin » Thu Sep 04, 2014 5:19 pm

Thanks Robert and krstcs, your explanation has helped me resolve my problem (I think).