Recorded Tests

Ranorex Spy, Recorder, and Studio.
Tnimni
Posts: 49
Joined: Thu Jan 02, 2014 4:03 pm

Recorded Tests

Post by Tnimni » Tue Jul 01, 2014 1:14 pm

Hi,

A client of my Company decided to develop an Automation suite for their UAT, according to our recommendation they purchased Ranorex, since it is the best tool to test our application.

unfortunately they decided to use recording instead of coding.

my problem is as follow:

the recording show the following

1. Key Sequence {F5}

this above activity is to be done on a custom textBox, they claim on their site it works fine. when i try to run it on my machine it works around 20% of the times.
Ranorex might be pressing F5, but the result doesn't appear on the screen.

I tried recording on my machine to debug and try and solve it, i got the following
1. sometimes it will record as Above
2. on other occasion it will record the following
2.1 Key Shortcut Down {F5}
2.2 Key Shortcut Up {F5}

When recording like in option 1 it will only work well at around 20% of the time when playing the recording.
When recording like in option 2 it works well at around 95% of the time when playing the recording.

Question is:

1. How does Ranorex decide which way to record?
2. Can i control that from Configuration?
3. can i easily replace all the occurrences of option 1 with option 2 in the recording i got from the client? there are around 200 occurrences

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

Re: Recorded Tests

Post by krstcs » Tue Jul 01, 2014 1:45 pm

Ranorex determines what to do with key-press events based on how long you hold the button.

You can change what is in the recording manually by dragging the object from the repository onto the action table and selecting what you want to do with it. Then just delete the old version. It won't hurt anything.

I would suggest that if you are just going to press a key, Key Shortcut is the appropriate action. Just use the "Press" event instead of "Up" or "Down".

One thing I have noticed is that you really need to do exactly what a user would do, so your module for entering data in a field should look like this:
1. Click the field.
2. Key Shortcut -> Ctrl-A
3. Key Shortcut -> Del
4. Enter the value (Key Sequence -> Value)
5. Validate the field has the value.

Also, I would suggest that timing is the most important part of the test. If you are having issues with key-press events, try adding a delay before the key sequence/shortcut actions.


Finally, I would highly recommend that you refactor the recording modules so that they do one thing, and one thing only (e.g. Click a button, or Enter text in a field (as above)). This will make it much easier to manage the test suite as you will only have one module to change when you need to add/delete/update actions. And, it will allow you to more easily re-use the modules, combining them as needed in the test suites/test cases so that the test suite/case controls the business flow of the test, instead of having that in a module.
Shortcuts usually aren't...