15 years ago
Error running groovy script in soapui
Hello everybody,
I'm running this piece of code on soaup :
import com.thoughtworks.selenium.*
class prova1groovy extends GroovySeleneseTestCase {
@Override
void setUp() throws Exception {
super.setUp('http://en.wikipedia.org/', '*chrome')
setDefaultTimeout(30000)
setCaptureScreenshotOnFailure(false)
}
void testWikipedia() throws Exception {
selenium.open("/wiki/Main_Page")
selenium.type("searchInput", "webservice")
selenium.click("searchGoButton")
}
}
but i've always gotten this error:
ERROR:groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class prova1groovy. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@11ba6f' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'
groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class prova1groovy. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@11ba6f' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:430)
at groovy.lang.GroovyShell.parse(GroovyShell.java:739)
at groovy.lang.GroovyShell.parse(GroovyShell.java:766)
at groovy.lang.GroovyShell.parse(GroovyShell.java:757)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException:
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:327)
at org.codehaus.groovy.reflection.CachedField.setProperty(CachedField.java:65)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2359)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3315)
at org.codehaus.groovy.runtime.InvokerHelper.setProperties(InvokerHelper.java:450)
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:427)
Please somebody can help me
I'm running this piece of code on soaup :
import com.thoughtworks.selenium.*
class prova1groovy extends GroovySeleneseTestCase {
@Override
void setUp() throws Exception {
super.setUp('http://en.wikipedia.org/', '*chrome')
setDefaultTimeout(30000)
setCaptureScreenshotOnFailure(false)
}
void testWikipedia() throws Exception {
selenium.open("/wiki/Main_Page")
selenium.type("searchInput", "webservice")
selenium.click("searchGoButton")
}
}
but i've always gotten this error:
ERROR:groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class prova1groovy. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@11ba6f' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'
groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class prova1groovy. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@11ba6f' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:430)
at groovy.lang.GroovyShell.parse(GroovyShell.java:739)
at groovy.lang.GroovyShell.parse(GroovyShell.java:766)
at groovy.lang.GroovyShell.parse(GroovyShell.java:757)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException:
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:327)
at org.codehaus.groovy.reflection.CachedField.setProperty(CachedField.java:65)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2359)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3315)
at org.codehaus.groovy.runtime.InvokerHelper.setProperties(InvokerHelper.java:450)
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:427)
Please somebody can help me
