Page 1 of 1

Work with close links.

Posted: Thu Feb 07, 2013 6:03 am
by varun
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.

Re: Work with close links.

Posted: Thu Feb 07, 2013 5:43 pm
by Support Team
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)

Re: Work with close links.

Posted: Mon Feb 11, 2013 7:36 am
by varun
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.

Re: Work with close links.

Posted: Mon Feb 11, 2013 2:25 pm
by Support Team
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

Re: Work with close links.

Posted: Tue Feb 12, 2013 5:53 am
by varun
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.

Re: Work with close links.

Posted: Wed Feb 13, 2013 2:02 pm
by varun
Support please provide me with the solution of this problem, I have already provided you with required snapshots and screenshots.

Regards,
Varun.

Re: Work with close links.

Posted: Wed Feb 13, 2013 3:47 pm
by Support Team
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
Regards,
Bernhard

Re: Work with close links.

Posted: Thu Feb 14, 2013 11:14 am
by varun
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.

Re: Work with close links.

Posted: Mon Feb 18, 2013 9:54 am
by Support Team
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

Re: Work with close links.

Posted: Mon Feb 18, 2013 1:12 pm
by varun
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.

Re: Work with close links.

Posted: Wed Feb 20, 2013 1:47 pm
by varun
Support, please let me know if there is any simple solution for this problem.

WR,
Varun.

Re: Work with close links.

Posted: Thu Feb 21, 2013 11:29 am
by Support Team
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

Re: Work with close links.

Posted: Fri Feb 22, 2013 1:09 pm
by varun
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.