Component Factory controls

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Component Factory controls

Post by Ciege » Mon Sep 12, 2011 7:50 pm

What version of Ranorex are you using? When I try to open that snapshot I get an error, but i am a little behind on Ranorex versions (3.0.2 currently) and I don't have the option to upgrade currently...

Anyway, from the screen shot you took it looks like a custom component of some sort that has the button/link embedded in the container. Without being able to look at the Spy Snapshot I cannot give specifics, that will have to wait for support to look at, but in the mean time you can tell Ranorex to click the right center portion of the container and it should click your button.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: Component Factory controls

Post by EugeneF » Mon Sep 12, 2011 10:02 pm

I am using 3.1.0... I was trying to do right-center click... does not work

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

Re: Component Factory controls

Post by Support Team » Tue Sep 13, 2011 8:44 am

Hi,

looks like your thirp party controls do not have accesibility implemented correctly, as Ciege observed correctly.
But basically recording a click action should work on the Element "fhgActivities". By recording this action the right coordinates should be chosen.

Regards,
Tobias
Support Team
.
Image

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: Component Factory controls

Post by EugeneF » Tue Sep 13, 2011 5:36 pm

Unfortunately "UpperRight", "CenterRight", and "LowerRight" still do not click on the button.
Is there any way to create custom control out of this button or any other solution for this problem?
Thanks.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Component Factory controls

Post by Ciege » Tue Sep 13, 2011 6:03 pm

Can you get the size and coordinates of the control? You can then do some math in code to tell the mouse to click in at a coordinate that you determine at runtime through your math. This way, even if the control size changes or you run your code on a different machine with a different resolution you would still be assured that the click is happening at the right place.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: Component Factory controls

Post by EugeneF » Tue Sep 13, 2011 6:11 pm

When I put absolute coordinate (1253;20) the button was clicked. However, as you said, when I resize application it does not work again.
How I can measure coordinate every time when screen id opened please?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Component Factory controls

Post by Ciege » Tue Sep 13, 2011 6:43 pm

Through Spy you can find the property that contains the size information about the control. Possibly ClientRectangle or even ScreenRectangle. With the size on the control in a variable you can get the location of the control (top left) from the property ScreenLocation (or similar)... Then with some quick math you can add the X location variable to the length of the control variable minus an arbitrary amount of say 5%. That will give you the X number to click at. Similarly, with the Y location variable plus 1/2 of the height of the control will give you the Y number to click at.

Simple math really...

XToClick = XOfControl + WidthOfControl - 5%OfWidthOfControl
YToClick = YOfControl - 1/2HeightOfControl

The 5% value may need a small tweak to get it just right, but you should be able to get there from here...
Last edited by Ciege on Tue Sep 13, 2011 6:55 pm, edited 1 time in total.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: Component Factory controls

Post by EugeneF » Tue Sep 13, 2011 6:54 pm

Thank you! I will try that!