DevExpres TabPage Control issues

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

DevExpres TabPage Control issues

Post by Ciege » Thu Oct 29, 2009 11:45 pm

I am having a couple of issues with the DevExpress Tabpage controls.

1) The TabPage controls have text and an 'X' close button on them. Ranorex can find the TabPage controls but cannot find or click the 'X'. See the TabPage control attachment below. When I try to get Ranorex to click the 'X' button I have it click the TabPage control at Location.CenterRight, but it only clicks at the end of the text on the tab not on the 'X' button.

2) This one is a bit more strange. If I use the following code I can get the TabPage object:

Code: Select all

Ranorex.TabPage HDTabPage = Host.Local.FindSingle("/form[@controlname='frmMainDialog']/element[@controlname='tabControlJobs']/tabpagelist/tabpage[@accessiblename='Training Job']", 60000);
However, after I already have a valid main form object (valid since I can find and click other items in the form just fine) I cannot find the TabPage with this code:

Code: Select all

Ranorex.TabPage HDTabPage = HDClientForm.FindSingle(".//element[@controlname='tabControlJobs']/tabpagelist/tabpage[@accessiblename='Training Job']", 60000);
I get an exception each time when I change from starting at Host.Local versus starting at my Form object.
Ranorex.ElementNotFoundException: No element found for path './/element[@controlname='tabControlJobs']/tabpagelist/tabpage[@accessiblename='Training Job']' within 1m. at Ranorex.Core.Element.FindSingle(RxPath path, Duration timeout) at Ranorex.Adapter.FindSingle(RxPath path, Duration timeout) at Installation_Test.Program.HardDollarClientTests(String strDateTimeStampClean, String strNavigationMode) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\Installation Test\Installation Test\Program.cs:line 1688

This is the xPath or HDClientForm:
/form[@controlname='frmMainDialog']



.
You do not have the required permissions to view the files attached to this post.
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...

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

Re: DevExpres TabPage Control issues

Post by Ciege » Fri Oct 30, 2009 12:09 am

I've attached a zip of a small .AVI here to show the issue with clicking the TabPage at Location.CenterRight.
You do not have the required permissions to view the files attached to this post.
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...

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

Re: DevExpres TabPage Control issues

Post by Support Team » Fri Oct 30, 2009 12:50 pm

ad 1) If the 'X' is not identified as an element of its own, you can only specify relative coordinates to click it (or use an image based approach using Ranorex V2.2). Location.CenterRight specifies the relative location proportional to the size of the element. CenterRight means click at 90% width of the image, i.e. if the element is 100 pixels width, click on pixel 90.
In your example a proportional relative location might not be suited, though, since the elements (tab page headers) have different size. The 'X' is always located about 10 pixels from the right side of the element, so you need to create the corresponding Location:
Size size = tabPage.ScreenRectangle.Size;
tabPage.Click(new Location(size.Width - 10, size.Height / 2));
ad 2) Both methods should work. However, with the ".//" at the front all elements inside your application will be searched. And if your application contains a large grid, a 60 seconds timeout might not be enough to find the element. When you omit the ".//", the FindSingle operation should work, because then both methods (full/relative path) are equivalent. IMHO generally placing the "//" operator in front of every relative operation is not a good idea, even if you want to be forwards compatible to future changes in your application.

Regards,
Alex
Ranorex Support Team

spot
Posts: 8
Joined: Fri Apr 30, 2010 10:16 pm

How to get name property of TabPage Control?

Post by spot » Sat May 01, 2010 2:19 am

Hello,

I have a AUT with a TabPageList and several TabPages. The rxPath I can get with the Spy is like ".../tabpagelist/tabpage[@accessiblename='Start']" with the Role "TabPage [tabpage]". The shown Name is equal to the Title and so it is only the visible (language depending) Text property.

But I would like to have something like a winforms Control where the Spy shows me the (unspecific) Role "Unknown [elemet]" and here the wanted real Name property (ControlName) - and not only the visible Text (ControlText).

Now my question: How can I get the real Name property from a TabPage?


An two additional questions, please:
At http://www.ranorex.com/support/user-gui ... apter.html I can read the "Multiple Adapters for one GUI element" example which shows to different buttons. At the .Net winforms button I can see that the ControlName can be seen. This is the same with a DevExpress SimpleButton. Here I can get a "control" with a rxpath like ".../element[@controlname='extId2TextEdit']" with the real Name property.

At the example on your web site
// Create Button adapter with RanoreXPath
Ranorex.Button button= "/form[@controlname='TestedApp']
                  /button[@controlname='button1']";
// Convert Button adapter to Control adapter
Ranorex.Control winFormsButton = new Ranorex.Control(button);
// Call 'GetPropertyValue' method provided by the Control adapter
Color color = winFormsButton.GetPropertyValue<Color>("BackColor");
you show how to convert the Ranorex.Button to a Ranorex.Control.
When I try to do this with
Ranorex.TabPage item = "<.../tabpagelist/tabpage[@accessiblename='Start']>";
Ranorex.Control winFormsTabPage = new Ranorex.Control(item);
I get a
Ranorex.CapabilityNotSupportedException: The element does not support the required capability 'control'.

Question 2.1: How can I do this with the TabPage?
Question 2.2: Where can I get a list of "elements" which can be "convert" to a Control (like the button in your example)?

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

Re: DevExpres TabPage Control issues

Post by Support Team » Mon May 03, 2010 11:36 am

Hi!
spot wrote:Question 2.1: How can I do this with the TabPage?
Question 2.2: Where can I get a list of "elements" which can be "convert" to a Control (like the button in your example)?
There is no such list which element can be converted to a control, because this is not necessary. Ranorex Spy shows you all of the information you need (in your case). As explained in the documentation GUI Adapter (http://www.ranorex.com/support/user-gui ... apter.html), it's only possible to use the Control adapter when the specified technology supports it. So in your case it seems that TabPage control of DevExpress doesn't provide the capability Control, only Accessible is available for TabPage.
I've checked this with a "xtraTabControl" and no child of this element supports the capability "Control". Only the xtraTabControl itself has this capability.
spot wrote:Now my question: How can I get the real Name property from a TabPage?
The only way to get the real Name of your property, is to ask your developers if they could write the Control Name of the item to an "accessibility attribute", for example to "Description". If they add this feature to your controls, you will be able to get the control name of the element over the "Accessible Description".

Or another method to get this property is the use Invoke Remotely.
See following Blog how to use http://www.ranorex.com/blog/transfering ... et-control
Invoke Remotely.

Regards,
Peter
Ranorex Support Team