Forum Discussion

zabelc's avatar
zabelc
New Contributor
16 years ago

GroovyCastException while Executing Script

I'm attempting to execute a Selenium Groovy script within SOAP-UI 3.0.1 & a recent nightly build of SOAP-UI Pro 3.0.2, and I'm getting the following error:

groovy.lang.GroovyRuntimeException: Failed to create Script instance for class: class com.example.tests.ffata. Reason: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.apache.log4j.Logger@12ffd81' with class 'org.apache.log4j.Logger' to class 'java.util.logging.Logger'

Is there any way to work around this?

3 Replies

  • zabelc's avatar
    zabelc
    New Contributor
    I dropped the selenium-java-client-driver.jar from the selenium-core-1.0.1.zip in the soapui\lib directory and ran the following
    package com.example.tests

    import com.thoughtworks.selenium.*

    class wikipedia 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")
        }
    }


    I downloaded the Selenium Core ZIP from this URL: http://release.seleniumhq.org/selenium- ... -1.0.1.zip
  • sumitmishra's avatar
    sumitmishra
    Occasional Contributor
    I am facing the same issue. Were you able to find the cause of this?