Forum Discussion

blade's avatar
blade
Occasional Contributor
9 years ago

Test Case not completing gracefully when Groovy Test Step accessing database.

Ready API 1.5.0

I have a Test Case with the following Steps:

1. A JDBC test step to get the count of rows in a certain table.

2. REST API Request 

3. Groovy Script to compare API Response with database (database connection and query are executed within the Groovy Script)

 

Upon running this test, once it gets to the groovy script all test steps become greyed out and the test case freezes. I have to close the test case.

 

NOTE: Previously I was running Ready API 1.4.1 and this issue did not occur. This only started happing after the upgrade.

 

I see the following error apeparing in the Ready API Log:

Wed Nov 11 14:37:14 GMT 2015:ERROR:Error notifying listener after run
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select * from test_step_run_history where execution_id = ?]; nested exception is org.h2.jdbc.JdbcSQLException: Column "icon_path" not found [42122-176]
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:660)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:695)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:772)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192)
at com.smartbear.ready.db.repository.jdbc.JdbcTestStepRunHistoryEntryRepository.findByExecutionId(JdbcTestStepRunHistoryEntryRepository.java:142)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:357)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:329)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:317)
at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.getLatestRun(DefaultLatestRunsProvider.java:140)
at com.eviware.soapui.impl.wsdl.panels.testcase.ProWsdlTestCaseDesktopPanel$InternalTestRunListener.afterRun(ProWsdlTestCaseDesktopPanel.java:921)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.notifyAfterRun(AbstractTestCaseRunner.java:316)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:188)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:1)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:154)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcSQLException: Column "icon_path" not found [42122-176]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
at org.h2.message.DbException.get(DbException.java:178)
at org.h2.message.DbException.get(DbException.java:154)
at org.h2.jdbc.JdbcResultSet.getColumnIndex(JdbcResultSet.java:3122)
at org.h2.jdbc.JdbcResultSet.get(JdbcResultSet.java:3210)
at org.h2.jdbc.JdbcResultSet.getString(JdbcResultSet.java:304)
at com.smartbear.ready.db.repository.jdbc.JdbcTestStepRunHistoryEntryRepository$TestStepRunHistoryEntryRowMapper.mapRow(JdbcTestStepRunHistoryEntryRepository.java:383)
at com.smartbear.ready.db.repository.jdbc.JdbcTestStepRunHistoryEntryRepository$TestStepRunHistoryEntryRowMapper.mapRow(JdbcTestStepRunHistoryEntryRepository.java:1)
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93)
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:708)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
... 19 more

 

Can this be investigated as a matter of urgency as this is affecting Regression on our Product. Or could the installer for Ready API 1.4.1 be supplied so I can downgrade to a more stable build.

  • Hi,

     

    The problem seems to be that your test history database hasn't been upgraded properly. In this situation the test history feature is normally disabled until the upgrade has been made, but for whatever reason this didn't happen in your case. We'll try to reproduce this bug and fix it.

     

    Meanwhile, you could probably solve this by going to the Compare or History tab and clicking on the Upgrade button.

     

    If this doesn't work, as a last resort you can disable the test history feature completely with the following workaround.

     

    1. Create a file called system.properties with the following single line:

        test.history.disabled=true

    2. Put in the directory .readyapi, which you'll find in your home folder (e.g. C:\Users\<your_user_name> on Windows)

    3. Restart Ready! API

     

    Hope this helps!

     

    Manne, Ready! API Developer

  • Hi,

     

    The problem seems to be that your test history database hasn't been upgraded properly. In this situation the test history feature is normally disabled until the upgrade has been made, but for whatever reason this didn't happen in your case. We'll try to reproduce this bug and fix it.

     

    Meanwhile, you could probably solve this by going to the Compare or History tab and clicking on the Upgrade button.

     

    If this doesn't work, as a last resort you can disable the test history feature completely with the following workaround.

     

    1. Create a file called system.properties with the following single line:

        test.history.disabled=true

    2. Put in the directory .readyapi, which you'll find in your home folder (e.g. C:\Users\<your_user_name> on Windows)

    3. Restart Ready! API

     

    Hope this helps!

     

    Manne, Ready! API Developer

    • blade's avatar
      blade
      Occasional Contributor

      Thanks Manne for your reply.

       

      I have downgraded to 1.4.1 for now as all my current tests run. If a maintenance build becomes available with a fix please let me know and I will give it a go.

       

      Regards,

      • MFagerlind's avatar
        MFagerlind
        Staff

        OK. But did you try any of the fixes I suggested?

         

        They should both work; if they didn't I'd have to find out why.

         

        Best

         

        Manne

    • jbuttimer's avatar
      jbuttimer
      Contributor

      Where is this Upgrade button on the history page? I'm having the same problem. Can you post a screen shot?

      • wthane's avatar
        wthane
        New Contributor

        Since I upgraded my test history database, I no longer see the button. My recollection was that it was easy to find. I guess if you don't see one then your database is up to date?

  • wthane's avatar
    wthane
    New Contributor

    I installed 1.5.0 again and upgraded the database by clicking the button on the History tab. My test case with groovy steps finishes normally now. Thanks for the assistance.

      • blade's avatar
        blade
        Occasional Contributor

        Hi,

         

        I have got time to peform the supplied steps and I got the following error now appearing on the logs, my test case with the groovy test step is not completing (steps remain greyed out):

         

        Wed Nov 18 08:04:34 GMT 2015:ERROR:Error notifying listener after run
           java.lang.IllegalStateException: Test history is disabled
            at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.a(DefaultLatestRunsProvider.java:95)
            at com.eviware.soapui.impl.wsdl.history.DefaultLatestRunsProvider.getLatestRun(DefaultLatestRunsProvider.java:138)
            at com.eviware.soapui.impl.wsdl.panels.testcase.ProWsdlTestCaseDesktopPanel$InternalTestRunListener.afterRun(ProWsdlTestCaseDesktopPanel.java:921)
            at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.notifyAfterRun(AbstractTestCaseRunner.java:316)
            at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:188)
            at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:1)
            at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:154)
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.util.concurrent.FutureTask.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Blade,

     

    I’ve reported this issue to our R&D team. Sorry for the inconvenience.