cancel
Showing results for 
Search instead for 
Did you mean: 

groovy question

Highlighted
Super Contributor

groovy question

hello,
I have a groovy script that updates the database. The script works fine and updates the database. However, in the 'test log' i see the following entry after the corresponding to the groovy script.

-> Script-result: false

What does this mean ?

The groovy script looks like

import groovy.sql.Sql

//get email address from properties file
def EmailStep = testRunner.testCase.getTestStepByName("Properties");
Email = EmailStep.getPropertyValue("Email");
log.info(Email)

//update database to verify account
driver = Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
sql = Sql.newInstance("jdbc:sqlserver://:1433;databaseName=databasename;user=;password=;") 
sql.execute(")");


THanks

Ali
3 REPLIES 3
Highlighted
Super Contributor

Hi Ali,

The script automatically returns the result of the last statement.. if you dont want to show anything in the log, please add

return null

at the end of your script..

regards!

/Ole
eviware.com
Highlighted
Super Contributor

so why does it return 'false'. My database was updated using the updated statement. shouldn't it return 'true'

Ali
Highlighted
Super Contributor

Hi Ali,

the execute method returns a flag indicating if the result was a resultSet (which could be further used..). In your case I guess the result is just a status-code or something..

regards,

/Ole
eviware.com
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors