cancel
Showing results for 
Search instead for 
Did you mean: 

Caching issues - Environment Testings

Highlighted
Occasional Contributor

Caching issues - Environment Testings

We have a composite project with different environments (testing, staging) set up, and the default is testing environment.
The two environments have different end points and JDBC connections (different database server and port #).

We run the project in different environments from the command line by using the following commands:

- default (testing)
testrunner.bat -j -M -A -r -f "c:\soapui\RegressionResults\testing" -EDefault "c:\soapui\projects\project"

- staging
testrunner.bat -j -M -A -r -f "c:\soapui\RegressionResults\staging" -Estaging "c:\soapui\projects\project"

The default (testing) run is working properly. However, many test cases failed in the stating run because the values returned from the data source are incorrect.
They seems to be the cached values from previous run (testing).

We have set cache definitions option to FALSE at the project level.
Is there any setting that clears the cache after each run?

Please advise. Thanks!
6 REPLIES 6
Highlighted

Re: Caching issues - Environment Testings

Hi,

What DataSource are you referring to?
Have you setup JDBC DataSources gathering values from different database queries? Please confirm what is the scenario.

Thanks,

Giscard
SmartBear Support


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

Re: Caching issues - Environment Testings

It is a single database connection to SQL Server. The query is a simple select statement in the data source.
It queries different database server (different ip and port #) for testing and staging environment.

For the test case, here are details about test steps:
1. data source: select top 1 id from products (id=12345 in testing db, and id=67890 in staging db)
2. get method: pass the id from the above data source in the request

For default (testing) run, the id passed in the raw request is 12345 which is correct.
For staging run, the id passed in the raw request is 12345 instead of 67890.

Thanks for your time!

SmartBear Support wrote:
Hi,

What DataSource are you referring to?
Have you setup JDBC DataSources gathering values from different database queries? Please confirm what is the scenario.

Thanks,

Giscard
SmartBear Support
Highlighted
Occasional Contributor

Re: Caching issues - Environment Testings

We could reproduce the issue from the UI. It happens the first time we open SoapUI Pro 5.1.2 and run the project with staging environment.
Per the http log, the ID passed in the REST request is incorrect. It is cached ID for the default testing environment, not staging environment.
It seems the parameter in the request is cached.
For the data source step, "Restarts DataSource when step is run" option is checked.
Please advise. Thanks!
Highlighted

Re: Caching issues - Environment Testings

Hi,

I have found the issue, it's not a caching issue. The JDBC connection that is being used in your "staging" environment is in fact the connection defined in your default environment. I only had that problem when using the TestRunner. Though project properties are pulled correctly from the specified environment (ex: "staging"), the JDBC connection comes from the default environment. I have logged the bug to the attention of our developers (SOAP-3149).

Regards,

Giscard
SmartBear Support


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

Re: Caching issues - Environment Testings

Hi,

Thanks for the reply.

I could replicate the issue in SoapUI GUI while running between environments.
If I open the Data Source step in any failed case, I notice the Connection is set to NONE (instead of testing/staging JDBC connection).
I added a test step to log the connectionString after the DataSource step. The connectionString is updated properly while running between environments.
It seems the JDBC connection is NOT reset (close the connectoin to testing db and open a new connection to staging db) while switching to a new environment.

In addition, is there any workaround for the JDBC connection issue you mentioned below?
I tried to put a Groovy script at the Event handler as described in the following post, but it does not work.

http://forum.loadui.org/viewtopic.php?f ... hilit=1210

Thanks again for your help.
Highlighted
New Member

Re: Caching issues - Environment Testings

Everything about environmental issues is also written and described at http://bigpaperwriter.com/blog/environmental-issues-essay, so you can have a composite project with different environments (testing, staging) set up, and the default is testing environment.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors