Dev.properties not considered/loaded when tests are executed using Ant on Jenkins


#1

Hello there,
I have a problem that XLT does not consider the dev.properties file when executing tests via an Ant task and the ScriptTestCaseSuite.inside a JUnit batchtest.

Trying to load property file ‘file:///opt/jenkins/jobs/test-job/workspace/test-project/config/default.properties’.
Loading properties from file: file:///opt/jenkins/jobs/test-job/workspace/test-project/config/default.properties
Trying to load property file ‘file:///opt/jenkins/jobs/test-job/workspace/test-project/config/project.properties’.
Loading properties from file: file:///opt/jenkins/jobs/test-job/workspace/test-project/config/project.properties
Trying to load property file ‘file:///opt/jenkins/jobs/test-job/workspace/test-project/config/test.properties’.
Loading properties from file: file:///opt/jenkins/jobs/test-job/workspace/test-project/config/test.properties

In this dev.properties file I have set

xlt.webDriver = firefox
xlt.webDriver.window.width = 1680
xlt.webDriver.window.height = 1050
xlt.webDriver.reuseDriver = true
com.xceptance.xlt.browser = FF
com.xceptance.xlt.loadStaticContent = true
com.xceptance.xlt.javaScriptEnabled = true
com.xceptance.xlt.js.debugger.enabled = false
com.xceptance.xlt.cssEnabled = true
com.xceptance.xlt.css.download.images = always
com.xceptance.xlt.output2disk = always

However, during the test run those settings are not set but instead it uses the ones defined in default.properties.

How do I know which properties file to update so that the settings above are applied during test execution.
I don’t think that the default.properties file is the proper place for that.
In the documentation I could not find an answer for that case:

“The file dev.properties contains development mode
settings. Use this file to modify the configuration so that it suits
your needs during test case development, that is when you create and
debug test cases from within your IDE.
It’s read in development mode only, but not during load testing.”

Executing these tests via Ant is a one time execution per job run and not a load test. That’s why I thought that the dev.properties file would be used.

I also have another issue but first I want to solve this. Maybe the additional information which will be present will help me understand the cause of that other problem.

Regards,
Patrice


#2

Hi Patrice,

Please take a look at the ANT build file of our Posters sample test suite that is shipped with XLT.
If you use this as template your tests should load the dev.properties file residing in the config directory of your test suite.

When running your tests as plain JUnit tests (with ANT, Maven or inside of your IDE), XLT will run in development mode and should load the dev.properties file. There is only one exception: in case the environment variable XLT_HOME is defined, XLT assumes that it is run as a load test and thus will skip to load this file.
This said, please double-check that your Jenkins job does not define such an environment variable.

Regarding your question about which properties file you should edit, feel free to take a look at our user-manual.
You should not touch default.properties as it is mainly for documentation purposes (which settings are available, what values can I define there and what’s the default value). Next, the project.properties file. It defines the settings for your entire test suite. Last but not least, the test.properties file, which can also be named differently, specifies the load test profile to use for a specific load test run and thus is likely to change.

All of the setting you stated above, can be defined in project.properties in case you don’t plan to use this test suite for load testing. Otherwise, dev.properties is the right choice.

PS: Please don’t mix WebDriver settings (those that start with xlt.webDriver) with XLT’s browser engine settings (e.g. com.xceptance.xlt.loadStaticContent). Doing so confuses people and leads to misunderstandings.

PPS: Individual support can be purchased on our XLT Portal.

Cheers,
Hartmut


#3

Hello Hartmut,
thanks for your detailed explanations. I will check with our PM for purchase of support.

Is this exception you mentioned documented anywhere in the XLT product documentation?

We defined an environment variable XLT_HOME and used in the build.properties to specify the XLT install directory on the current host. After renaming it to XLT_INSTALL the dev.properties is loaded now.

Regards,
Patrice


#4

Good to know that you were able to solve the issue, Patrice.

No, unfortunately not. But I have filed an issue about that. So it’s just a matter of time :wink:

Cheers,
Hartmut


closed #5

opened #6