Synchronization issue?

Ask general questions here.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Synchronization issue?

Post by c676228 » Tue May 05, 2015 11:47 pm

Hi,

When I do some data drive test with data stored in an excel sheet.
I noticed some strange issues. The issues occurs randomly, not always.
Say, I have a form with several fields, all data is from an excel sheet.
However, sometimes the first one or two fields will be empty, sometimes the first field will miss the first few characters. The report log doesn't say the field(s) are not found. It seems that the field doesn't have time to have the key sequence. I insert action "EnsureVisible". It seems to solve the issue.

but I am not sure if this is the cause. Since the behavior is random and I am not sure if this is the fix.

Any idea?

Thanks,
Betty

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

Re: Synchronization issue?

Post by krstcs » Wed May 06, 2015 3:36 pm

Remember that Ranorex will do each action as quickly as possible, so sometimes you will need to force Ranorex to wait until the SUT is ready for the action.

In this case that may be causing what we call a "timing issue."

You should put a small wait (5 or 10 ms should do) or a validate exists on the element, or the ensure visible as you did. You just want to put something in there before this action that will slow Ranorex down just enough to make it work consistently.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: Synchronization issue?

Post by c676228 » Fri May 08, 2015 5:32 pm

I am aware of the timing issue. But I didn't know that Ranorex does each action as quickly as possible which could cause some actions to be skipped in front of end user and the first input field of a modal dialog will be skipped in a data drive test.

For each iteration, I put waitfor, ensurevisible to make sure the first UI element of a modal dialog exist and visible before key in data. Unfortunately I see some odd behavior in Chrome (doesn't occur to IE and Firefox)
that some steps and the first field of a modal dialog is skipped.

In Chrome, a modal dialog is supposed to be canceled (due to the email for the new user is already in the database), then open a new modal dialog for the next iteration. Due to some strange reasons, Ranorex probably sees the modal dialog is there(the cancel action doesn't close the modal dialog quick enough? I used Delay.Milliseconds(200) after cancel click), it skips open a new modal dialog, then skip the first input field and jump to the second input field of the modal dialog which was supposed to be canceled, enter data immediately. This definitely is timing issue. But I don't see the same behavior in Firefox and IE.

I seem to notice some issue when actions switch from recording module to user code or from user code to recording module. It seems all timing related.

Thanks,
Betty

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

Re: Synchronization issue?

Post by krstcs » Fri May 08, 2015 9:32 pm

Yeah, I have found that each of the browsers have their own quirks, including different timing issues.

Just fiddle with the timings until you can get them consistent and then leave them alone, that's what I do. :D
Shortcuts usually aren't...