Writing a Custom Adapter

Class library usage, coding and language questions.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Writing a Custom Adapter

Post by atom » Mon Jul 27, 2009 4:29 pm

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

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Writing a Custom Adapter

Post by atom » Wed Jul 29, 2009 5:16 pm

Any clues on this Support Team?

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

Re: Writing a Custom Adapter

Post by Support Team » Thu Jul 30, 2009 11:32 am

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
.
Image

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Writing a Custom Adapter

Post by slavikf » Fri Nov 19, 2010 12:20 am

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.
Attachments
WS.rxsnp
Attaching SnapShot of that app
(242.2 KiB) Downloaded 238 times

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

Re: Writing a Custom Adapter

Post by Support Team » Fri Nov 19, 2010 11:20 am

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
.
Image

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Writing a Custom Adapter

Post by slavikf » Fri Nov 19, 2010 11:50 pm

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...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Writing a Custom Adapter

Post by sdaly » Sat Nov 20, 2010 5:43 pm

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)

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

Re: Writing a Custom Adapter

Post by Support Team » Mon Nov 22, 2010 3:46 pm

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
.
Image

vengaishiva
Posts: 62
Joined: Wed Mar 09, 2011 4:40 pm

Re: Writing a Custom Adapter

Post by vengaishiva » Mon Apr 11, 2011 2:27 pm

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

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

Re: Writing a Custom Adapter

Post by Support Team » Tue Apr 12, 2011 11:43 am

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
.
Image

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Writing a Custom Adapter

Post by sdaly » Wed Apr 13, 2011 10:12 am

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!

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

Re: Writing a Custom Adapter

Post by Support Team » Wed Apr 13, 2011 10:24 am

Thanks! I added a link to the corresponding section in the 3.X User Guide.

Regards,
Alex
Ranorex Team
.
Image

vengaishiva
Posts: 62
Joined: Wed Mar 09, 2011 4:40 pm

Re: Writing a Custom Adapter

Post by vengaishiva » Mon Apr 18, 2011 11:06 am

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

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

Re: Writing a Custom Adapter

Post by Support Team » Mon Apr 18, 2011 12:40 pm

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
.
Image

vengaishiva
Posts: 62
Joined: Wed Mar 09, 2011 4:40 pm

Re: Writing a Custom Adapter

Post by vengaishiva » Mon Apr 18, 2011 2:47 pm

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?