How can I access Global Parameters from Program.cs?

Ask general questions here.
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

How can I access Global Parameters from Program.cs?

Post by stapes » Wed Mar 23, 2016 4:12 pm

I have added an Email Logger to my Test Suite.

Code: Select all

// add a report logger that sends reports via email
string from = "[email protected]";
string to = "[email protected]";  		
string subject="Ranorex Report for CustomLogging";
string cc="";
MailLogger mailLogger = new MailLogger(from , to, subject, cc  );
I would like to be able to put the values shown here, from, to & cc - in the Global Parameters.

Is this possible? If so, how?

User avatar
Ranorex Guru
Ranorex Guru
Posts: 6553
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: App get crashed while tap on element in iOS Instrumented app

Post by odklizec » Wed Mar 23, 2016 9:41 pm


You can get the value of Global Parameter via code like this...

Code: Select all

string from = TestSuite.Current.Parameters["ParameterName"];
Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration