Dataconnector binding

Ask general questions here.
harendra
Posts: 15
Joined: Fri Aug 17, 2012 3:32 pm

Dataconnector binding

Post by harendra » Mon Sep 17, 2012 1:57 pm

Hi,

I already have a data connector defined in my solution via GUI. However for my code development I need to get the file name with which the data connector was created. I did have a look at the data connector class , filedataconnector class etc. and they do give a filename method, but they donot give a method which can reference an existing data connector. from where I can get the filename. Any help would be beneficial.

regards
Harendra

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

Re: Dataconnector binding

Post by Support Team » Tue Sep 18, 2012 12:33 pm

Hi,

There are different ways how you can access the data connectors in code, here are two of them:
Report.Info("Name of Connector: "+DataSources.All[0].Connector.Name);
Report.Info("Name of Connector: "+DataSources.Get("The Name of the Connector").Connector.Name);
You can also create your connectors in code: Test data from .csv.

Regards,
Markus
Ranorex Support Team

harendra
Posts: 15
Joined: Fri Aug 17, 2012 3:32 pm

Re: Dataconnector binding

Post by harendra » Tue Sep 18, 2012 4:40 pm

Markus,

Thank you very much for your help. Actually I wanted to get the file path of the already defined data connector. This helped me to actually get the connector itself and then I type-casted and achieved what I wanted.

Harendra