Spy vs recorder

Ranorex Studio, Spy, Recorder, and Driver.
topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Spy vs recorder

Post by topcatalpha » Fri Nov 18, 2011 10:26 am

Hi,

I want to verify labeltext languages in a adobe air application, but i can't seem to manage it using the recorder tool validation, though the view spy does show all properties of the label.

Using the recorder, pressing the validation button and mouseover the label, the object is unknown and i can only verify his existence, not the text of the label. So i stop recording, start the view spy and press the track button. select the label. In the list of objects i can select the label and view/change the text property.

Does anyone know how i can easely validate the labeltext while using the recorder ?

Thx,

Kurt

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

Re: Spy vs recorder

Post by Support Team » Fri Nov 18, 2011 10:45 am

Hi,

If you just track the specific label with Spy are you getting the label or the unknown element, I mean which one is marked blue?
Is the unknown element a descendant of the label?

Regards,
Markus
Ranorex Support Team

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Fri Nov 18, 2011 11:12 am

Hi, thx for the quick response.

With the view spy the label is marked red, unknown 'textLine' when clicking on it :
- sometimes i get marked red 'container group' in the list of the view spy.
- sometimes i get "element text" line as normal text.

in the last case i can select the parent in the treeview list, which is the type richtext with a text property and the correct value as visible on screen. This value should be validated.

I just found out that when using the scrollwheel during mouseover i can change the object to his parent.

When i use the recorder->Validate button the label is marked in purple and i do no have this possibility to change to the parent object. (as in view spy)

grtz,

Kurt

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

Re: Spy vs recorder

Post by Support Team » Fri Nov 18, 2011 11:27 am

Hi,
When i use the recorder->Validate button the label is marked in purple and i do no have this possibility to change to the parent object. (as in view spy)
You have the possibility to change it like in spy, you just have to check the "Enable Hotkeys" checkbox on the Ranorex Recorder Toolbar.

Regards,
Markus
Ranorex Support Team

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Fri Nov 18, 2011 11:44 am

Ok, thx.

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Mon Nov 21, 2011 10:40 am

Hi,

Wel it also seems that the recorder is capturing the wrong elementdata from the adobe air application while recording. Sometimes a click on a button/label cannot be played. i have to manually adjust the line in my recorded test.
(i suppose i cannot use the scrollwheel to select the parent, while clicking on a label/button ?)

When using the spy i very often get the message that my app is not wel instrument'ed, while it worked before. a compleet restart of all software usually solves the problem.

in other words, its getting hard to make a testcase for my adobe air app.

any suggestions ?

thx.

kurt

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

Re: Spy vs recorder

Post by Support Team » Tue Nov 22, 2011 10:14 am

Hi,
(i suppose i cannot use the scrollwheel to select the parent, while clicking on a label/button ?)
Yes, you are right, this is not possible. The only workaround is to manually adjust the line in my recorded test.
in other words, its getting hard to make a testcase for my adobe air app.
Which instrumentation are you using, the "Automation Lib", or did you make the instrumentation with the instrumentation wizard?
Are you clicking on a certain button when the warning is shown, or can you determine any special circumstances which leads to this behavior?
Can you also send us a Ranorex Snapshot file, one from the Spy and one during your execution, or even better a small sample application?

Regards,
Markus
Ranorex Support Team

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Tue Nov 22, 2011 11:09 am

Hi, Thx for the reply.

My setup
1. I ran instrumentation wizard, selected adobe flex.
2. Debug for browsers is enabled.
3. I have unchecked preloader.
4. Confirmed. (debuggers are downloaded and installed.)
5. restarted all applications, including ranorex.
6. Our application NHC to test, has added rxautomationlib.swc. (NHC is adobe air.)

(is this correct so far ?)

Issues
1. Some of the recorded mouseclicks in our NHC application are marked as "item could not be found" and i cannot build the testrun in ranorex. So i have to manually adjust the steps in my test. For this i have a workaround.

2. A testcase with 2 tests to run for our NHC application. In each test our application is opened and closed at the end of the test. It seems one iteration is OK, but running 2 iterations always fails the second one with a message that the application is not instrumented. I added a step with wait for not exist to be sure the application is closed before starting the next test. But without improved result. The only way to make my test run again is restarting the ranorex software. It seems Ranorex connects to the NHC application the first time, but the second time it cannot connect. Maybe some connection is not properly closed before the new/next test runs.

3. Our NHC application works with project files and it seems that with rxautomationlib.swc we cannot open our previously build projectfiles. So our developers have changed it to RxAutromationlibAir.swc and now we can open our previously build project files. This problem is solved for now.

Question
The only thing bugging me now is that i cannot run a compleet testcase because the ranorex software sometimes cannot connect the to adobe air application.
- first time is always OK
- when i cannot connect (message that it is should be isntrumented.) i can solve it with restarting ranorex.

Any idea how i can solve this problem ?

Thc,

Kurt

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

Re: Spy vs recorder

Post by Support Team » Tue Nov 22, 2011 1:07 pm

Hi,
(is this correct so far ?)
Yes, this is correct.
Can you please send us your Flash, Air, Ranorex and OS version?
Please also determine that the process is really closed before you start the second test, because if the process is still running this can trigger errors.

Regards,
Markus
Ranorex Support Team

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Tue Nov 22, 2011 2:21 pm

Windows XP pro 32 bit SP3
flashplayer : 11.1.102.55
adobe Air : 3.1.0.4880


Last 2 steps for each test

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'FormNiko_Home_Control.ButtonClose' at 9;21.", repo.FormNiko_Home_Control.ButtonCloseInfo, new RecordItemIndex(30));
repo.FormNiko_Home_Control.ButtonClose.Click("9;21");
Delay.Milliseconds(760);

Report.Log(ReportLevel.Info, "Wait", "Waiting 5000ms for item 'FormNiko_Home_Control' to not exist.", repo.FormNiko_Home_Control.SelfInfo, new RecordItemIndex(31));
repo.FormNiko_Home_Control.SelfInfo.WaitForNotExists(5000);

Our NHC software verifies if an instance is already running, so it can only be started once.
I shall add a wait for 15s between each test and send you the result.

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Tue Nov 22, 2011 3:07 pm

Hi Markus,

1 test with 2 iterations.

delay
- 10s the second test fails.
- 15s the second test fails.
- 1m the second test fails
- 5m the second test succeeded.

in case of the first 3 fails, when i stop the test and restart it manually, the first test succeeded again.
This problem also occurs when writing and recording scripts.
For now i will add a delay 5 minutes between each test.
Can i be of any further assistance for this problem ?

greetz,

Kurt

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

Re: Spy vs recorder

Post by Support Team » Tue Nov 22, 2011 5:27 pm

Hi,

Thanks for the information!

It seems that your application can't be closed, but to make sure we would need some more information.
Please execute your test program and take a look at the Windows Task Manager if your process is still running after you have clicked on the "Close Button" in the first iteration?
Also test if the Ranorex Port Listener is still active after the click on the Close Button. Just open the CMD and input "netstat -an".
Is there an entry with the port number: 61111?
If it is still running try to manually end the process after the first iteration and test if the second iteration runs as expected?

Regards,
Markus
Ranorex Support Team

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Wed Nov 23, 2011 11:11 am

1 iteration, after first iteration a wait time 5m
- After the buttonclose the process is not visible in the taskmanager.
- Port used for our application is 4567 to connect to a helper (dotnet) application.
- Also the helper process (called configurator.exe) is not visible in the taskmanager.

Using the netstat -an i see this :
- first line : ...... foreign address 127.0.0.1:61111 CLOSE_WAIT
- second line : Local address 127.0.0.1:61111 ..... FIN_WAIT_2
- third line : local address 127.0.0.1:4567 ..... TIME_WAIT (port from our application, but process doesn't exist) is this normal behavior ?

When 5 minutes are passed and ranorex stopped testing
- first line : ...... foreign address 127.0.0.1:61111 CLOSE_WAIT
Other lines are gone.

Restart the test is OK !


1 iteration, after first iteration a wait time 5s
- After the buttonclose the process is not visible in the taskmanager.
- Port used for our application is 4567 to connect to a helper (dotnet) application.
- Also the helper process (called configurator.exe) is not visible in the taskmanager.

When 5 seconds are passed - Using the netstat -an i see this :
- local address 127.0.0.1:4567 ..... TIME_WAIT (port from our application, but process doesn't exist) is this normal behavior ?

Restart the test is OK !


1 iteration with 5 seconds failed during test
- Ranorex testing stopped.
- Our Configurator.exe and Home Control.exe are still running.

Another problem that i need to solve is that a test that succeeds, sometimes fails because an element could not be found. i want to get back to this later on.

So test is interrupted by failure!

Using the netstat -an i see this :
- first line : Local address 127.0.0.1:61111 ..... FIN_WAIT_2
- third line : local address 127.0.0.1:4567 ..... TIME_WAIT (port from our application, but process doesn't exist) is this normal behavior ?

i closed our application :
- third line : local address 127.0.0.1:4567 ..... TIME_WAIT

Restart the test is OK !


We know 2 iterations with 5minutes delay between is successfull


2 iterations, after first iteration a wait time 30s
- After the buttonclose the processes are not visible in the taskmanager.

Using the netstat -an during those 30s (before 2th iteration), i see this :
- first line : ...... foreign address 127.0.0.1:61111 CLOSE_WAIT
- second line : Local address 127.0.0.1:61111 ..... FIN_WAIT_2
- third line : local address 127.0.0.1:4567 ..... TIME_WAIT

Second iteration starts and results in error.
Please make sure you have correctly instrumented your AIR application....


When Ranorex testing stopped and report appears
- first line : ...... foreign address 127.0.0.1:61111 CLOSE_WAIT
Other lines are gone.

A'm i correct that the 61111 listener is the lib in our app ?

(fyi :Our other dotnet applications runs 1500 iterations open/close with ranorex without any problem.)


Grtz,

Kurt

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Wed Nov 23, 2011 3:02 pm

Hi,

Some extra info :

Some tests in our adobe air app are unstable. I mean
Run a test and the element is found to click on, the element is found to validate.
Next testrun it fails on the same elements and it remains a problem. I have to replace the step in my test with the element captured using the view spy. So when the element is replaced it remains ok for the first next testrun. Too bad it happens again in some further tests and i have to repeat this.

- Elements are not always recognized.
- After using the view spy i have the same error as mentioned in my previous post " (Please make sure you have correctly instrumented your AIR application....)

- netstat shows the 61111 multiple times :

Active Connections

Proto Local Address Foreign Address State
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:4567 0.0.0.0:0 LISTENING
TCP 0.0.0.0:6002 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7002 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1026 0.0.0.0:0 LISTENING
TCP 127.0.0.1:3819 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3846 127.0.0.1:4567 ESTABLISHED
TCP 127.0.0.1:3857 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3870 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3871 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3872 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3873 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3874 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3875 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3876 127.0.0.1:61111 CLOSE_WAIT
TCP 127.0.0.1:3877 127.0.0.1:61111 ESTABLISHED
TCP 127.0.0.1:3878 127.0.0.1:61111 ESTABLISHED
TCP 127.0.0.1:4567 127.0.0.1:3846 ESTABLISHED
TCP 127.0.0.1:61111 0.0.0.0:0 LISTENING
TCP 127.0.0.1:61111 127.0.0.1:3857 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3870 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3871 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3872 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3873 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3874 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3875 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3876 FIN_WAIT_2
TCP 127.0.0.1:61111 127.0.0.1:3877 ESTABLISHED
TCP 127.0.0.1:61111 127.0.0.1:3878 ESTABLISHED
TCP 192.168.1.123:139 0.0.0.0:0 LISTENING


Should i keep this for another topic or is it related ?

Thx for your support,

Kurt

topcatalpha
Posts: 47
Joined: Tue Sep 06, 2011 7:48 am

Re: Spy vs recorder

Post by topcatalpha » Wed Nov 23, 2011 4:38 pm

Okay,

some progress concerning the elements not found in adobe air. It seems flash uses an autogenerate number for some elements. Our developers will investigate if they can solve this problem in the code as we think it cannot be solved in the ranorex tool.

In other words the name/path of the element changes each time the software is restarted.
Same element captured by viewspy - two examples here :

/form[@title='Niko Home Control']/container/container[@id='mainView']/container[@id='mainContent']/container[@id='vs']
/container[@id='configuration']/container[@id='mapView']/container[@id='scrollLayer']
/container/element[@id='moduleLayer']/container[@displayname='InputModuleMapView3598']/container[@id='stateIcon']
/container/element[@id='_SmallIconButton_Image1']

RESTART AGAIN
/form[@title='Niko Home Control']/container/container[@id='mainView']/container[@id='mainContent']/container[@id='vs']
/container[@id='configuration']/container[@id='mapView']/container[@id='scrollLayer']
/container/element[@id='moduleLayer']/container[@displayname='InputModuleMapView3619']/container[@id='stateIcon']
/container/element[@id='_SmallIconButton_Image1']


grtz,

Kurt