Automation on different System Name

Experiences, small talk, and other automation gossip.
Posts: 9
Joined: Thu Sep 28, 2017 12:08 pm

Automation on different System Name

Post by Esivakumar » 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

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

Re: Automation on different System Name

Post by odklizec » Wed Oct 11, 2017 12:02 pm


I would suggest to read below blog post, in which you can learn how to properly share data between modules, including storing/reading data to/from parameters: ... o-another/
I'm not quite sure if the coded way you posted is recommended/publicly available way of storing/reading parameters.
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

Posts: 19
Joined: Wed Aug 30, 2017 7:58 pm

Re: Automation on different System Name

Post by DavidHay » Wed Oct 11, 2017 5:16 pm

I added a variable to the repository in Ranorex. It is then available in c# as yourrepo.yourvariable. That way you can set a default value in Ranorex or override it in code if need be.