cancel
Showing results for 
Search instead for 
Did you mean: 

Datasource connections and switching environments

Highlighted
Occasional Contributor

Datasource connections and switching environments

Hi, I have just started working with SOAPUI NG. I have successfully set up a project and testsuites with authorizations, database connections and environments and everything is working perfectly when I switch environments except for one thing: there doesn't seem to be a relation between environments and database datasource connections.  

 

I have several Testsuites with a database datasource, in a project with multiple test environments. I would assume (or hope) the database datasource connection switches to the corresponding DB when I switch environments too, but this isn't the case. I have to change it manually for each Testsuite every time I switch environments. 

 

Am I doing something wrong? 

 

 

4 REPLIES 4
Highlighted
Occasional Contributor

Re: Datasource connections and switching environments

I ended up using environment properties because I saw some funky stuff going on with DB connections and environments as well.

 

https://community.smartbear.com/t5/SoapUI-NG/Databases-for-Environments-JDBC-Driver-Connection-Strin...

 

Hopefully that helps.

Highlighted
Occasional Contributor

Re: Datasource connections and switching environments

Thanks, I've set it up using your instruction: I've made a DB connection that is using the properties. Although the connection tests work, the Datasource in the TestSuite tells me that 'some connection settings are missing'. 😞 Any idea? 

Highlighted
Occasional Contributor

Re: Datasource connections and switching environments

Btw, the JDBC driver connection (com.microsoft.sqlserver.jdbc.SQLServerDriver) looks like this now: 

 

jdbc:sqlserver://${#Project#DBHost}:${#Project#DBPort};databaseName=${#Project#DBDatabase};user=${#Project#DBUsername};password=${#Project#DBPassword}

 

(the last one shows up as PASS_VALUE)

 

It works in the Database configuration screen.

Highlighted
Occasional Contributor

Re: Datasource connections and switching environments

Aaaaaah, I found it. I was editing the properties at project level. When I was checking the properties at environment level, I found that my freshly made DB connection had no parameters yet! 

 

So I added them there, and now it works. 🙂

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors