Incorrect Global Parameter Value on TeamCity Test Run?

Ask general questions here.
Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Incorrect Global Parameter Value on TeamCity Test Run?

Post by Fergal » Mon Feb 12, 2018 5:28 pm

My Test Suite has a Global Parameter set to a certain value. Modules in the test suite access that parameter value using:

Code: Select all

TestSuite.Current.Parameters["parameterName"]
When the tests are run locally the correct value for the Global Parameter is used. However, when the tests are run from a TeamCity build on a test server, they use an old and incorrect value for the Global Parameter.

What could be causing this?

One idea I had is that perhaps the file containing the Global Parameter value is not being versioned by our Git. Which file in a Ranorex solution contains the values of Global Parameters?

Many thanks.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Incorrect Global Parameter Value on TeamCity Test Run?

Post by krstcs » Tue Feb 13, 2018 3:50 pm

Fergal,

A couple of things:

1. All test suite-related settings (all parameters and data source definitions) are stored in the *.rxtst file. It is XML, so it can be edited in a text editor (try Notepad++, it's great). Note: Be careful what you edit and always make a backup of the file before you edit so you don't have issues, and do keep it in source control as it defines the test execution.

2. My guess on the parameter issue is that you somehow have the wrong parameter name in TeamCity's build script. Make sure the case and spelling are exactly the same as what is in your test suite. "myParameter" =/= "MyParameter". Ranorex parameters are case sensitive. This would cause your test to grab the default parameter value instead of the intended runtime value.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Incorrect Global Parameter Value on TeamCity Test Run?

Post by Fergal » Tue Feb 13, 2018 5:27 pm

Thanks very much for that info and your helpful reply krstcs.
krstcs wrote:My guess on the parameter issue is that you somehow have the wrong parameter name in TeamCity's build script
Your guess is right, it is a TeamCity issue :oops: The TeamCity build configuration includes a parameter value that is overriding the value in the Ranorex test suite. Hence, when the project is run locally it is using the global parameter value from Ranorex. When it is run on TeamCity it is using TeamCity's parameter value.

Thanks again.