Page 1 of 1

Question about variables.

Posted: Fri Dec 14, 2012 1:24 pm
by Maslak
Hi,i`m doing automotive tests on 3 computers. I wanna change variable for every computer as login of computer name ( System.Environment.MachineName ). Can someone help me? I`m trying to do that as class but doesn`t work.

Re: Question about variables.

Posted: Wed Dec 19, 2012 11:46 am
by Support Team
Hello,

You could use use the following code to store your hostname in a global parameter:
public void getHostname()
{					
	TestSuite.Current.Parameters["Hostname"] = Environment.MachineName; // get current hostname
	Report.Info("New: " + TestSuite.Current.Parameters["Hostname"]); // store hostname in global parameter 'hostname'
}
Regards,
Markus (T)