Page 1 of 1

Incorrect Global Parameter Value on TeamCity Test Run?

Posted: Mon Feb 12, 2018 5:28 pm
by Fergal
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.

Re: Incorrect Global Parameter Value on TeamCity Test Run?

Posted: Tue Feb 13, 2018 3:50 pm
by krstcs
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.

Re: Incorrect Global Parameter Value on TeamCity Test Run?

Posted: Tue Feb 13, 2018 5:27 pm
by Fergal
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.