Spy vs recorder

Ranorex Spy, Recorder, and Studio.
User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Thu Nov 24, 2011 11:47 am

Hi,

The auto generated "displayname" attribute shouldn't be taken per default, so there must be a reason why Ranorex takes it. Can you therefore send us a Ranorex Snapshot file of the specific element that we can identify why it was taken?
There are also some workarounds, how you can eliminate such attributes.
You can use regex in your rxPath to ignore the number of the displayname or you can edit the path weight of the attribute that it is no longer taken by Ranorex by default, if there is another unique attribute which can be taken.
Here are some useful links about this topic:
http://www.ranorex.com/support/user-gui ... xpath.html
http://www.ranorex.com/blog/eliminate-d ... norexpaths
But if you send us the Snapshot we can also try to find a workaround for you.
A'm i correct that the 61111 listener is the lib in our app ?
Yes, this is correct, it is the Automation lib.

Regards,
Markus
Ranorex Support Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Fri Nov 25, 2011 10:27 am

I guess the problem is that i have multiple elements to validate with the same name and the only difference is a random number. but the number can change when restarting the software. In worst case the numbers are switched. i guess when using regex i cannot determine which element of the two should be validated. (or i am missing something?)

fe

/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']

/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='InputModuleMapView3182']/container[@id='stateIcon']
/container/element[@id='_SmallIconButton_Image1']

We've done a test yesterday : Our developer can change the name of the elements so they will always get the same autogenerated number, even after reloading/restarting the software. This test was successfull.
(i will read the articles also. thanks.)

An example and the snapshot is attached.




Do you have any idea why port 61111 is still in use while program process is already killed ?

Thx,

Kurt

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Fri Nov 25, 2011 11:59 am

Hi,
Do you have any idea why port 61111 is still in use while program process is already killed ?
It is not in use, it just takes some time to close the TCP communication.
"Close_Wait" means: "Indicates that the server has received the first FIN signal from the client and the connection is in the process of being closed".
(or i am missing something?)
Okay you are right, in your case it is really hard to identify the elements uniquely, but you can try to combine regex with the index of the shown elements like:
instead of:
/form[@title='Niko Home Control']/container/container/container/container/container/container/container/container/element/container/element/element/element/container[@displayname='instance345676']

you can use this for the first shown container:
/form[@title='Niko Home Control']/container/container/container/container/container/container/container/container/element/container/element/element/element/container[@displayname~'instance'][1]

if the positions of the elements in your flash application are always the same.
Or your developers can try to set an unique attribute to make the identification easier.

Regards,
Markus
Ranorex Support Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Mon Nov 28, 2011 9:24 am

ok, thx.
Support Team wrote: It is not in use, it just takes some time to close the TCP communication.
"Close_Wait" means: "Indicates that the server has received the first FIN signal from the client and the connection is in the process of being closed".
Is there something our developers can do to solve this problem "air not instrumented..."

Problem occurs when :
- Using View Spy while ranorex studio is active.
- Ranorex remains active in testrun and runs 2 or more iterations.

Does not occur :
- 2 same testruns of 1 iteration, so ranorex testrun has stopped between first and second iteration.
- Can be solved by restarting ranorex studio.
- Wait 5 minutes between 2 iterations of the same test.
- Not using view spy.

Regards,

Kurt

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Wed Nov 30, 2011 2:26 pm

Hi,

We will try to reproduce the issue on a system with the specific environment and we will contact you as soon as we can reproduce/fix the issue.

Regards,
Markus
Ranorex Support Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Thu Dec 01, 2011 8:52 am

Ok, Thx.

If it could help you to reproduce this issue ...
Our software can be downloaded at http://www.niko.eu/engb/niko/software-f ... aad7e675f3

I can send you the file to replace with ranorexlib if you like?


Regards,

Kurt

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Thu Dec 01, 2011 10:19 am

Hi,

We tried to reproduce the issue but we weren't able to. I create a small Air application (Air 3.1.0.4880) and instrumented this app with the Ranorex Lib method. This was just a small app with a button and a text-field inside. Then I created a recording which starts this app, executes a few actions and stops it. This was running in a loop and I never had the issue that the application doesn't close completely.
  • Which instrumentation do you use?
  • Did you try this on a small application with just a few controls inside?
topcatalpha wrote:If it could help you to reproduce this issue ...
Our software can be downloaded at http://www.niko.eu/engb/niko/software-f ... aad7e675f3
Thank you for the link, but we need the complete source to instrument your application and I guess this isn't possible. :)
Would it be possible to create a small application which causes this issue?

Regards,
Peter
Ranorex Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Thu Dec 01, 2011 11:43 am

Hi,

Small app is no option at this moment, but i have sent an E-mail to the support team with links for our application with ranorexlib. So it is instrumented and could be tested.

Grtz,

Kurt

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Thu Dec 01, 2011 12:42 pm

Hi,

This is for sure the best to reproduce your issue. Do you post this link to our forum or will you send this link to [email protected]?

Regards,
Peter
Ranorex Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Thu Dec 01, 2011 1:44 pm

It should be in the support Mailbox now. :-)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Thu Dec 01, 2011 3:14 pm

Hi,

Thank you we received your mail. We observed that the listener stays open but this doesn't affect the automation.
Please could you try one simple test?
Just open two spy then your application and use instant tracking to track one element on your GUI.
Now one spy should have an invalid state on the air top most element.
Please could you also ask your developers if they close the application with NativeApplicaton exit or in another way?

Thanks in advance.

Regards,
Peter
Ranorex Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Fri Dec 02, 2011 9:22 am

So, this is what i tested :

1. Opened a spy.
2. Opened a second spy.
3. Started our application.
4. Track an element with the first spy.
5. Track the same element with the second spy. (is this what you asked to do ?)
6. Took a screenshot added to this post.

Result :
- So first spy shows the tree and element.
- second spy shows Container group (invalid)

Remarks :
- i suppose this is correct behavior ?
- i do get the invalid state sometimes when using ranorex studio and one spy to track an element. Is this an issue ?
- Sometimes the red rectangles do not appear anymore when tracking an element. But when clicking on it, it does show the correct path.
- When recording, i can only validate +/- 5 elements and then there is no popup with properties for the element anymore. So i cannot confirm. Then i have to save the project, restart ranorex and i can validate again.


Maybe to much information, but i like to give you as much as possible to help. Thx for the great support so far. :-)

Our developers are working to eliminate the autogenerate number. And i will let you know how they close the application.

Cheers,

Kurt

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

Re: Spy vs recorder

Post by topcatalpha » Fri Dec 02, 2011 10:04 am

Hi, the applciation is closed using :

Code: Select all

NativeApplication.nativeApplication.exit();
Grtz,

Kurt

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Spy vs recorder

Post by Support Team » Fri Dec 02, 2011 10:33 am

Hi Kurt,

Thank you for the information. They aren't too much. :)

We found an issue which could cause this behavior. Would it be possible to try your tests with that attached new Automation Lib and send us feedback if this works with your application?
RanorexAutomation_02122011.zip
(58.9 KiB) Downloaded 199 times
Thank in advance.

Regards,
Peter
Ranorex Team
.
Image

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

Re: Spy vs recorder

Post by topcatalpha » Mon Dec 05, 2011 9:23 am

Hi,

Thx for the new ranorexlib.

Tested again with two spy's and both can track the same element without problems. So i guess this problem can be marked as solved. :-) Selecting elements in our adobe app doesn't show the invalid anymore.. So this is great news.



Two iterations of my testcase still fails in the second iteration so i added my recorded test to this post.

1. Use a windows XP
(using the "program files" dir to start our app. in windows 7 it is program files (x86) so this added testfile will not work unless you change the dir in the first step.)
2. make dir "D:\Home automation\Config Files"
3. Copy added "NewProject.nhcp" file to "D:\Home automation\Config Files"
4. i suppose you can use the added .rxrec file in a ranorex project.
5. Run the 2 iterations.

6. I also added a screenshot of the issue when it occurs.

Regards,

Kurt