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

Re: groovy question

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

Re: groovy question

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

Ali
Highlighted
Super Contributor

Re: groovy question

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
Top Kudoed Authors