Forum Discussion

HawkeyesTester's avatar
HawkeyesTester
Occasional Contributor
3 years ago

JDBC Data Source step not returning records when testcase executed outside ReadyAPI desktop client

We are using SpiraTest/RemoteLaunch as our testcase management tool and automation hub.  When our tests are executed via RemoteLaunch, our data source step doesnt appear to be returning records from our postgres db.  When the testcases are executed via ReadyAPI deskop client, the data source successfully returns the expected records from our db.

 

Here's our ReadyAPI test case setup:

1. The testcase ID from SpiraTest (TCID) is sent to our ReadyAPI project via Remote Launch (Spira) and stored as a project level property.  (confirmed)

2. The TCID is then used as a query parameter in a JDBC data source step to fetch testcase specific data that will be populated into our parameterized REST request.

 

From the ReadyAPI log files, I can confirm the testcase is being executed, but the data source step appears to be retrieving zero rows from postgres. When executing a testcase from outside the desktop client, do we need to manage our db connection strings differently or is there additional configuration needed to be able to execute these queries in our data source step?

  • KarelHusa's avatar
    KarelHusa
    Champion Level 1

    HawkeyesTester,

    if you use environments, the database connection may belong to a specific environment.

     

    In such a case, I recommend double-checking if the environment is set from SpiraTest and matches your expected environment.

     

    • HawkeyesTester's avatar
      HawkeyesTester
      Occasional Contributor

      Thanks for the response.  I was able to confirm in the logs that the environment is getting set correctly when the test case is executed.  Confirmed this by looking at the raw request being made.  However, my JDBC data source step still doesn't bring back any data from my postgres tables.

      • KarelHusa's avatar
        KarelHusa
        Champion Level 1

        HawkeyesTester

        there must be some difference; if not in DB (connect string), you need to check the DB query.

         

  • HawkeyesTester's avatar
    HawkeyesTester
    Occasional Contributor

    It seems the licensed version of ReadyAPI is using an old version of the postgres jar file.  Can that be updated?

    • KarelHusa's avatar
      KarelHusa
      Champion Level 1

      HawkeyesTester,

      yes, you can replace the DB driver with an updated version in bin/ext directory (e.g., ReadyAPI-3.42.1/bin/ext/postgresql-9.3-1102.jdbc41.jar).