Page 1 of 1

Dataconnector binding

Posted: Mon Sep 17, 2012 1:57 pm
by harendra
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

Re: Dataconnector binding

Posted: Tue Sep 18, 2012 12:33 pm
by Support Team
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

Re: Dataconnector binding

Posted: Tue Sep 18, 2012 4:40 pm
by harendra
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