Page 1 of 2

Writing a Custom Adapter

Posted: Mon Jul 27, 2009 4:29 pm
by atom
Hiya

From what ive read the Ranorex API is based on Plug-ins
Does that means its possible to write custom adapters?

We have an owner drawn custom MFC grid control... we have a wrapper class for it within our framework
But I'm wondering if we could take our wrapper class and turn it into an Adapter type

Thanks

Re: Writing a Custom Adapter

Posted: Wed Jul 29, 2009 5:16 pm
by atom
Any clues on this Support Team?

Re: Writing a Custom Adapter

Posted: Thu Jul 30, 2009 11:32 am
by Support Team
Hi atom,
in general we provide a Ranorex Plugin API but it`s not officially released at the moment, mainly due to the lack of documentation and samples. We already worked together on plugins with some partner companies - so it is possible to create Ranorex Plugins, but right now it requires good programming skills and additional support services from Ranorex.

For more information about the additional support services (and pricing) needed in order to write plugins, please contact our support team by email (support_at_ranorex.com)!

Regards,
Christian
Support Team

Re: Writing a Custom Adapter

Posted: Fri Nov 19, 2010 12:20 am
by slavikf
Any news or updates on Release of Plugin SDK for Ranorex?
I tested trial version and GridView component in our application is not recognized by RanoRex. So i trying to figure out the way to do it.

On this screenshot you can see, that whole grid selected - can't recognize individual rows/columns...
Image
P.S. That's Windows desktop application.

Re: Writing a Custom Adapter

Posted: Fri Nov 19, 2010 11:20 am
by Support Team
Hi,

There are two solution to access the elements of this table. The first would be to implement MSAA for this control. Therefore please take a look to following blog http://www.ranorex.com/blog/enabling-au ... s-controls

The second solution would be to use the GDI-Plugin, which is the easier solution, because you don't have to implement MSAA for this control. Please take a look to following blog
http://www.ranorex.com/blog/automation- ... re-plug-in

We will release a Plugin SDK in the future, but I cannot tell you a date yet.

Regards,
Peter
Ranorex Team

Re: Writing a Custom Adapter

Posted: Fri Nov 19, 2010 11:50 pm
by slavikf
I tried "GDI-Plugin" way.
I found that by using Plugin i can access and click any such control, which was unaccessible before. Good.
However, i can't use it in my app (see example above), because i need to access grid cell and i don't know it's value ahead of time.
By other words, using GDI, to access any cell i need to use path, like "rawtext[@caption='NIKON50']". However, that "NIKON50" - is what i trying to get from that cell. So, i need cell's value to get cell's value... :shock:

So, do you think Plugin SDK will help me resolve this issue (get access to cell's value)? If so, i willing to obtain private training from Ranorex on how to write Plugins.
Even, if it is not release version of SDK...

Re: Writing a Custom Adapter

Posted: Sat Nov 20, 2010 5:43 pm
by sdaly
slavifk

If you can identify the row and column you need access to then you can get the cells value...

Example..

Dim itemid as rawtext = "/table/rawtext[rawtext='1234']
Dim cellyouareafter as rawtext = "/table/rawtext[column='3' and row='" & itemid.row & "']"
messagebox.show(cellyouareafter.text)

Re: Writing a Custom Adapter

Posted: Mon Nov 22, 2010 3:46 pm
by Support Team
In your case the column index , for example, might be a bit problematic because the header text values get their own column assigned because the text is centered.

Keep in mind that all information available to Ranorex in the rawtext plugin is what is drawn to the screen. The row and column indices are inferred from the x/y distribution of the rawtext elements, and if you need to scroll, the row index of the first visible row will still be zero.

Regarding the plugin:
Your grid is a Stringray Grid MFC control, right?
In that case it is probably easier to implement IAccessible (MSAA) for this control. Normally, this should be done by the control vendor, but it seems like they skipped that step :(

And implementing it yourself is only possible if the grid API is comprehensive enough to fetch information about the locations, contents and sizes of the cells. Unfortunately, there seems to be no public API doc for these controls.

Michael
Ranorex Team

Re: Writing a Custom Adapter

Posted: Mon Apr 11, 2011 2:27 pm
by vengaishiva
Hi,
I am also facing the same problem. But the ranorex can't identify the table in MFC. It can only identify the rawtext within it as i have applied raw text plugin. The table is identified as 'Element'. Any help on this?
Regards,
Siva R S

Re: Writing a Custom Adapter

Posted: Tue Apr 12, 2011 11:43 am
by Support Team
Hi,

do you instrument the raw text plug in correctly?
Therefore have a look at following links:
Ranorex 2.X: http://www.ranorex.com/blog/automation- ... re-plug-in
Ranorex 3.X: http://www.ranorex.com/support/user-gui ... tions.html

Can you provide us a Ranorex snapshot file of your application under test.
Following link will show you how to generate such a snapshot file:
http://www.ranorex.com/support/user-gui ... files.html

You can either attach this snapshot file to your next post in our forum, or you can send it to support_at_ranorex.com.

Regards,
Tobias
Support Team

Re: Writing a Custom Adapter

Posted: Wed Apr 13, 2011 10:12 am
by sdaly
The link to the GDI blog page needs updating I think...It explains how to set up the GDI plugin for version 2 but not 3!

Re: Writing a Custom Adapter

Posted: Wed Apr 13, 2011 10:24 am
by Support Team
Thanks! I added a link to the corresponding section in the 3.X User Guide.

Regards,
Alex
Ranorex Team

Re: Writing a Custom Adapter

Posted: Mon Apr 18, 2011 11:06 am
by vengaishiva
Hi,
Its a simple MFC grid with some data in it. Due to security reasons i can't provide the snapshot. I have installed the rawtext plugin correctly and its able to identify the raw text within grid. But the grid is not identified as 'Table'. How can i make ranorex to identify the MFC grid as table?
Thanks,
Siva R S

Re: Writing a Custom Adapter

Posted: Mon Apr 18, 2011 12:40 pm
by Support Team
vengaishiva wrote:But the grid is not identified as 'Table'. How can i make ranorex to identify the MFC grid as table?
You can't. If Ranorex does not identify the grid as a table, you can't cast it to the Table adapter. However, if Ranorex does identify cells in the table, just use the RanoreXPath Ranorex Spy generates for the cells.

If suggest you read the following sections in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... x-spy.html
http://www.ranorex.com/support/user-gui ... html#c3199

Regards,
Alex
Ranorex Team

Re: Writing a Custom Adapter

Posted: Mon Apr 18, 2011 2:47 pm
by vengaishiva
Hi Support team,
Thanks for your reply. The problem is that ,there is a MFC grid already in my application. I cant extend the grid for MSAA implementation as suggested by you in the forum ,so that ranorex can identify MFC grid. Is there any other workaround so that i get the MFC table as Table and not as element?