Work with close links.

Ranorex Spy, Recorder, and Studio.
varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Work with close links.

Post by varun » Thu Feb 07, 2013 6:03 am

Hi Support,

In a desktop application, two type of form opens up by double-click on record. I have to close the form by click on its cross link but path for cross links are different so how can I integrate this to single step so that RX automatically identify the form and click on close link. RX Path of cross link for both forms are->
1.
titlebar/button[@accessiblename='Close']
2.
container[@controlname='rDockDashboard']/container[@controlname='documentContainer1']
/container[@controlname='DockTabStrip3']


I tried to work by using "or" in repository but it didn't worked, like-> //button[@accessiblename='Close'] or //container[@controlname='DockTabStrip3']

Whats the correct way to make it workable ?

Regards,
Varun.

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

Re: Work with close links.

Post by Support Team » Thu Feb 07, 2013 5:43 pm

Hello,

You would need to close each form separately using your recording.
Alternatively, you could write User Code to close both forms in one method.

Regards,
Markus (T)
.
Image

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Mon Feb 11, 2013 7:36 am

Hi Markus,

Thanks for feedback. Well, another problem here I am facing is RX not identifying cross link which appear in various tabs of .net base Desktop application. Can you please provide me with its fix.
FYI, I am providing you with RX snapshot of one of tab window.

Thanks and Regards,
Varun.
Attachments
WinTabForCrossLink.rxsnp
UnIdentifiedCrossLink
(148.26 KiB) Downloaded 175 times

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

Re: Work with close links.

Post by Support Team » Mon Feb 11, 2013 2:25 pm

Hi,
varun wrote:Thanks for feedback. Well, another problem here I am facing is RX not identifying cross link which appear in various tabs of .net base Desktop application. Can you please provide me with its fix.
FYI, I am providing you with RX snapshot of one of tab window.
What do you mean with "cross link", currently I have no clue which element this should be. Which element you try to get according to the snapshot? Please could you provide us a RxPath or a screenshot of the element?

Thanks in advance.

Regards,
Peter
Ranorex Team
.
Image

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Tue Feb 12, 2013 5:53 am

Hi Peter,

Actually I am talking about close link on the top right corner of tab form. Problem is RX Spy unable to identify this link so in scripting I am facing problem to close the tab form.
As you already have RX snapshot of entire form so now I am providing you with screenshot of close link "CloseLink.png", highlighted in red rectangle. Please go through the attachment and let me know how can I draw tool to click on this link.

I tried by using following code snippet and steps as in "RXSteps_CloseLink.png" file, but unfortunately it's clicking on center of the form instead of close link. Code Snippet -

Code: Select all

var closeDemandWindow = repo.RTSPOWorkbench.CloseDemandWindow;
closeDemandWindow.Click();
Delay.Seconds(2);
Please guide.

Thanks,
Varun.
Attachments
RXSteps_CloseLink.png
RX recorded steps
RXSteps_CloseLink.png (80.03 KiB) Viewed 1020 times
CloseLink.png
CloseLink
CloseLink.png (16.38 KiB) Viewed 1020 times

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Wed Feb 13, 2013 2:02 pm

Support please provide me with the solution of this problem, I have already provided you with required snapshots and screenshots.

Regards,
Varun.

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

Re: Work with close links.

Post by Support Team » Wed Feb 13, 2013 3:47 pm

Hello Varun,

Is the snapshot you sent me a snapshot from the whole application? If not please send a new snapshot from the whole application.
Is it possible to recognize the element with Microsoft inspect?
As workaround you can try to use mouse coordinates to close the window as shown in the image below.
MouseCoordinates.png
MouseCoordinates.png (6.68 KiB) Viewed 1007 times
Regards,
Bernhard
.
Image

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Thu Feb 14, 2013 11:14 am

Hello Bernhard,

Thanks for the feedback. It works by specifying coordinates in the script. I would appreciate if you please tell me why RX Spy was not identifying close link form the tab window. FYI, I have attached RX snapshot of whole tab.

Thanks again.

Regards,
Varun.
Attachments
TabCloseLink.rxsnp
CloseLink
(290.77 KiB) Downloaded 171 times

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

Re: Work with close links.

Post by Support Team » Mon Feb 18, 2013 9:54 am

varun wrote: I would appreciate if you please tell me why RX Spy was not identifying close link form the tab window.
The reason is that this DocumentTabStrip control is a custom "owner-drawn" control that does not follow the design for testability rules. The "x" button is not a real button, but just a drawn picture and the control does not convey any information about that "x" button to Ranorex.

If 3rd party controls draw such a button and they follow best-practices, then they also provide information about that button to testing tools and disabled persons, e.g. by implementing the MSAA interface for the "x" button. Sadly, the 3rd party control vendor this application uses is known for not following such best practices...

As a workaround, you can use relative coordinates or image-based locations.

Regards,
Alex
Ranorex Team
.
Image

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Mon Feb 18, 2013 1:12 pm

Hi Alex,

Thanks for your feedback. I have another problem here in case of specifying co-ordinates of close link, in such case Test Script successfully executes only in my system but not on other systems, may be they have different resolution.
As a workaround, you can use relative coordinates or image-based locations.
Here, are you talking about Image based recording? If so I have tried it but its also not working for this case.

Please clear my doubts and kindly let me know how I can solve this problem?

Regards,
Varun.

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Wed Feb 20, 2013 1:47 pm

Support, please let me know if there is any simple solution for this problem.

WR,
Varun.

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

Re: Work with close links.

Post by Support Team » Thu Feb 21, 2013 11:29 am

Hello Varun,

You can also try
1) pressing the appropriate keyboard shortcut, which is probably Ctrl-F4 (focus first if necessary)
2) invoking the action "Close" on the form below the tab container (example from your snapshot:"frmDemandCurve")
3) image-based click should work fine in this case (for example with grey-scale preprocessing and 0.98 similarity)
4) create a user code method which clicks at the right-upper edge of the container minus a fixed offset which will probably not change

Cheers,
Michael
Ranorex Team
.
Image

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

Re: Work with close links.

Post by varun » Fri Feb 22, 2013 1:09 pm

Hi Michael,

Thank you for the response.
I guess, point 1 should work. Will try and let you know in case any further Query.
Thanks again!

Regards,
Varun.