Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

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

  • omatzura's avatar
    omatzura
    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
  • alibaba82's avatar
    alibaba82
    Super Contributor
    so why does it return 'false'. My database was updated using the updated statement. shouldn't it return 'true'

    Ali
  • omatzura's avatar
    omatzura
    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