cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Occasional Contributor

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.

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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

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

16 REPLIES 16
New Contributor

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

I have this problem, too. I reverted back to version 1.4.1. Here's a link to the download:

 

https://support.smartbear.com/downloads/readyapi/nightly-builds/

Community Manager

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

Hi Blade,

 

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

---------
Tanya Gorbunova
SmartBear Community Manager

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

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

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

Occasional Contributor

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

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,

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

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

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

I should add that no maintenance fix will be made for this problem, because this is not a general problem with Groovy Test Steps.

 

Something just went wrong when your database was to be upgraded. Hopefully upgrading the database manually, as described above, will solve the problem permanently. If you can't upgrade your database, and you don't mind losing your earlier test history, you can also move the database directory - .ready/db inside your home directory - away and restart.

 

If none of these suggestions work for you, please open a support ticket and we'll help you!

 

/Manne

Occasional Contributor

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

I will give the steps you provided a go at some stage. I have current project commitments that need to be met without disruption. I will try this once these are over. In the mean time I will use build 1.4.1. If there is any other user reading this forum that is experiencing the same problem they are welcome to try and if possible provide feedback informing that the provided steps worked (or did not work).

 

Thanks,

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

I understand totally! Just curious how the suggested fixes would work for you.

 

Good luck with your project! :-)

 

/Manne

New Contributor

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

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.

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