Hi,
We want to pass some value from config file
I added below code to "C:\Documents and Settings\<User>\Application Data\RanorexConfig3.xml"
<appSettings>
<add key="DBConnectionString" value="Password=xxxx;Persist Security Info=True;User
ID=xxx;Initial Catalog=testing;Data Source=1.1.1.1">
</appSettings>
I am trying to retrive using below code
ConfigurationSettings.AppSettings["DBConnectionString"].ToString();
But I am getting object null reference
Let me know where I have gone wrong
Thanks,
Abhigna
passing data from config file
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: passing data from config file
Hi,
The Ranorex intern parser will ignore your custom tags, therefore you cannot access it through UserCode.
As workaround you can create another XML file which you can read at runtime.
You can use the normal .Net functionality to read such XML files.
Regards,
Markus
Ranorex Support Team
The Ranorex intern parser will ignore your custom tags, therefore you cannot access it through UserCode.
As workaround you can create another XML file which you can read at runtime.
You can use the normal .Net functionality to read such XML files.
Regards,
Markus
Ranorex Support Team
-
- Posts: 49
- Joined: Thu Feb 03, 2011 3:15 pm
Re: passing data from config file
Hi Support team,
Thanks for update. I will try this.
What about environment variables.
Can we create environment variable in system and use that in my script?
Thanks,
Abhigna
Thanks for update. I will try this.
What about environment variables.
Can we create environment variable in system and use that in my script?
Thanks,
Abhigna
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: passing data from config file
Hi,
If you mean global variables then this is possible, there is a section in our User Guide which describes this topic very well.
There are also some forum posts: http://www.ranorex.com/forum/post10434.html#p10434 about this topic.
Regards,
Markus
Ranorex Support Team
If you mean global variables then this is possible, there is a section in our User Guide which describes this topic very well.
There are also some forum posts: http://www.ranorex.com/forum/post10434.html#p10434 about this topic.
Regards,
Markus
Ranorex Support Team