GDI Plugin Configuration

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

GDI Plugin Configuration

Post by atom » Wed Apr 20, 2011 8:29 pm

Hiya

In Ranorex 301

Is there no way to programatically configure the GDI/RawText plugin?
Perhaps not in the standard API, but some configuration class I can dynamically load?

The problem is we have a test dev environment and a test execution environment
And we dont want to have to move the config file between these environments each time a developer
writes a test that needs this enabled on a certain control

Thanks

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

Re: GDI Plugin Configuration

Post by Support Team » Thu Apr 21, 2011 10:20 am

Hi,

With following lines of code you can add process and class names programatically to the config of your RawText.
//To add the process name to the config
RawTextFlavor.Instance.ProcessNames.Add(new Regex("processname pattern"));
//To add the class name to the config
RawTextFlavor.Instance.ClassNames.Add(new Regex("classname pattern"));
Don't forget to add the namespace
using Ranorex.Plugin;
Regards,
Peter
Ranorex Team

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

Re: GDI Plugin Configuration

Post by atom » Thu Apr 21, 2011 11:30 am

Excellent thanks!

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

Re: GDI Plugin Configuration

Post by slavikf » Thu Apr 28, 2011 9:37 pm

I have following entry in my "GDI Capture Settings -> Window Class Names":
GXWND.*
So, i decided to try API, mentioned above.
I removed my entry from "GDI Capture Settings -> Window Class Names" and added this code to recording module:
RawTextFlavor.Instance.ClassNames.Add(new Regex("GXWND.*"));
But got following error:
Ranorex.ElementNotFoundException: Failed to find item 'Review1Repository.FormSelect_Procedure.FirstRowN' within the specified timeout of 3000ms. ---> Ranorex.ElementNotFoundException: No element found for path 'element/element[@controlid='1013']/rawtext[@column='0' and @row='1']' within 3000ms.
--- End of inner exception stack trace ---
at Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException)
at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)
at Review1.Review1RepositoryFolders.FormSelect_ProcedureAppFolder.get_FirstRowN() in c:\AutoRex\Review\Review1\Review1Repository.cs:line 2162


What did i do wrong? Why it's not working?

P.S. Here is screenshot of base class:
Untitled.png
As you can see it's name is GXWND. So i tried to use "GXWND" without *, but result is same.
You do not have the required permissions to view the files attached to this post.

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

Re: GDI Plugin Configuration

Post by Support Team » Fri Apr 29, 2011 11:12 am

Hi,

It seems the Plug-Ins are not loaded when you add your class to the config.
Please execute following line of code before you edit the config using the API.
var plugins = Ranorex.Core.PluginManager.Instance;
plugins.LoadDefaultPlugins();
Regards,
Peter
Ranorex Team