Forum Discussion
New_SoapUI_Guy
11 years agoNew Contributor
Hi Bhavya,
I am also running into same problems that you faced. Can you please let me know how you fixed the problem. I installed SoapUI Pro 5.1.2 and Groovy 2.3 along with jdk 1.7.
Whenever I am trying to import any classes, it gets an error. Here is my groovy script content and error.
Thu Oct 23 14:50:45 EDT 2014:ERROR:An error occurred [startup failed:
Script1.groovy: 3: Unknown type: IMPORT at line: 3 column: 2. File: Script1.groovy @ line 3, column 2.
import groovy.sql.Sql
^
org.codehaus.groovy.antlr.ASTParserException: Unknown type: IMPORT at line: 3 column: 2. File: Script1.groovy @ line 3, column 2.
at org.codehaus.groovy.antlr.AntlrParserPlugin.buildAST(AntlrParserPlugin.java:263)
at org.codehaus.groovy.control.SourceUnit.convert(SourceUnit.java:272)
at org.codehaus.groovy.control.CompilationUnit$12.call(CompilationUnit.java:649)
try
{
import groovy.sql.*
def ERROR_MSG = "Database does not have newly created user."
sql = Sql.newInstance("jdbc:sqlserver://10.100.48.249","knowlagentcreate", "knowlagentcreate007!", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
// Sql.newInstance("jdbc:sqlserver://${Excel_Environment#SQL_DB_Server_IP}", "demo", "password", "com.mysql.jdbc.Driver")
row = sql.firstRow("select count(*) from KA_USER where KA_USER.login = 'jyao'")
log.info("Count: ${row.count}")
assert (1 != row.count):ERROR_MSG
log.info row.count
}
finally
{
sql.close()
}
Thanks,
Vijay
I am also running into same problems that you faced. Can you please let me know how you fixed the problem. I installed SoapUI Pro 5.1.2 and Groovy 2.3 along with jdk 1.7.
Whenever I am trying to import any classes, it gets an error. Here is my groovy script content and error.
Thu Oct 23 14:50:45 EDT 2014:ERROR:An error occurred [startup failed:
Script1.groovy: 3: Unknown type: IMPORT at line: 3 column: 2. File: Script1.groovy @ line 3, column 2.
import groovy.sql.Sql
^
org.codehaus.groovy.antlr.ASTParserException: Unknown type: IMPORT at line: 3 column: 2. File: Script1.groovy @ line 3, column 2.
at org.codehaus.groovy.antlr.AntlrParserPlugin.buildAST(AntlrParserPlugin.java:263)
at org.codehaus.groovy.control.SourceUnit.convert(SourceUnit.java:272)
at org.codehaus.groovy.control.CompilationUnit$12.call(CompilationUnit.java:649)
try
{
import groovy.sql.*
def ERROR_MSG = "Database does not have newly created user."
sql = Sql.newInstance("jdbc:sqlserver://10.100.48.249","knowlagentcreate", "knowlagentcreate007!", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
// Sql.newInstance("jdbc:sqlserver://${Excel_Environment#SQL_DB_Server_IP}", "demo", "password", "com.mysql.jdbc.Driver")
row = sql.firstRow("select count(*) from KA_USER where KA_USER.login = 'jyao'")
log.info("Count: ${row.count}")
assert (1 != row.count):ERROR_MSG
log.info row.count
}
finally
{
sql.close()
}
Thanks,
Vijay