GDI Plugin Configuration : Automation API

GDI Plugin Configuration

Class library usage, coding and language questions.

GDI Plugin Configuration

Postby atom » Wed Apr 20, 2011 9: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
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: GDI Plugin Configuration

Postby Support Team » Thu Apr 21, 2011 11: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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: GDI Plugin Configuration

Postby atom » Thu Apr 21, 2011 12:30 pm

Excellent thanks!
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: GDI Plugin Configuration

Postby slavikf » Thu Apr 28, 2011 10: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
Untitled.png (19.75 KiB) Viewed 211 times

As you can see it's name is GXWND. So i tried to use "GXWND" without *, but result is same.
User avatar
slavikf
 
Posts: 97
Joined: Mon Sep 13, 2010 10:07 pm
Location: Toronto, Canada

Re: GDI Plugin Configuration

Postby Support Team » Fri Apr 29, 2011 12:12 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests