Automation on different System Name
Posted: Wed Oct 11, 2017 11:18 am
Hi we are automating 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.
This Question was asked already and answered as
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'
}
But our point is that above code is not working which copy it on user code
Kindly say a way to use the above code like where we have to insert and call it
This Question was asked already and answered as
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'
}
But our point is that above code is not working which copy it on user code
Kindly say a way to use the above code like where we have to insert and call it