groovy question
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007
05:53 PM
06-11-2007
05:53 PM
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
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://
sql.execute("
THanks
Ali
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2007
11:31 PM
06-11-2007
11:31 PM
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
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2007
10:01 AM
06-12-2007
10:01 AM
so why does it return 'false'. My database was updated using the updated statement. shouldn't it return 'true'
Ali
Ali
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2007
10:42 AM
06-12-2007
10:42 AM
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
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
