Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalStateException: The Graphene runtime isn't initialized. #266

Open
jagdeepjain opened this issue Aug 2, 2020 · 4 comments

Comments

@jagdeepjain
Copy link

jagdeepjain commented Aug 2, 2020

java.lang.IllegalStateException: The Graphene runtime isn't initialized.

Issue happens when running testng parallel tests.

Test should run in parallel
Test fails with the the error The Graphene runtime isn't initialized.
Steps To Reproduce
  1. Clone https://github.com/jagdeepjain/webdriver-arquillian-test
  2. run docker-compose up from the project root directory
  3. run mvn clean test from the project root directory
Additional Information

Maven home: /opt/apache-maven-3.5.0
JDK 1.8
Running on MacOS 10.15.5 (19F101

Console Output:

INFO: Detected dialect: W3C
Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 3.683 sec <<< FAILURE! - in TestSuite
f(org.jagdeep.example.arquillian.google.tests.GoogleTest2)  Time elapsed: 0.046 sec  <<< FAILURE!
java.lang.IllegalStateException: The Graphene runtime isn't initialized.
	at org.jagdeep.example.arquillian.google.tests.GoogleTest2.f(GoogleTest2.java:27)

f(org.jagdeep.example.arquillian.google.tests.GoogleTest3)  Time elapsed: 0.047 sec  <<< FAILURE!
java.lang.IllegalStateException: The Graphene runtime isn't initialized.
	at org.jagdeep.example.arquillian.google.tests.GoogleTest3.f(GoogleTest3.java:27)

f(org.jagdeep.example.arquillian.google.tests.GoogleTest1)  Time elapsed: 0.047 sec  <<< FAILURE!
java.lang.IllegalStateException: The Graphene runtime isn't initialized.
	at org.jagdeep.example.arquillian.google.tests.GoogleTest1.f(GoogleTest1.java:27)


Results :

Failed tests:
  GoogleTest1>Arquillian.run:138->f:27 » IllegalState The Graphene runtime isn't...
  GoogleTest2>Arquillian.run:138->f:27 » IllegalState The Graphene runtime isn't...
  GoogleTest3>Arquillian.run:138->f:27 » IllegalState The Graphene runtime isn't...

Full stack trace below:

<full-stacktrace>
              <![CDATA[java.lang.IllegalStateException: The Graphene runtime isn't initialized.
at org.jboss.arquillian.graphene.GrapheneRuntime.getInstance(GrapheneRuntime.java:116)
at org.jboss.arquillian.graphene.Graphene.instance(Graphene.java:323)
at org.jboss.arquillian.graphene.Graphene.waitGui(Graphene.java:216)
at org.jboss.arquillian.graphene.enricher.StaleElementInterceptor.intercept(StaleElementInterceptor.java:43)
at org.jboss.arquillian.graphene.proxy.InvocationContextImpl.invoke(InvocationContextImpl.java:87)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$2.call(GrapheneContextualHandler.java:241)
at org.jboss.arquillian.graphene.context.BrowserActions.performAction(BrowserActions.java:62)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:237)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.intercept(GrapheneContextualHandler.java:263)
at org.openqa.selenium.remote.RemoteWebDriver$ByteBuddy$cRdPATVS$$EnhancerByGraphene$$f9a3849c.manage(<generated>)
at org.jagdeep.example.arquillian.google.page.GooglePage.goTo(GooglePage.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:129)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$1.invoke(GrapheneContextualHandler.java:169)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$2.call(GrapheneContextualHandler.java:241)
at org.jboss.arquillian.graphene.context.BrowserActions.performAction(BrowserActions.java:62)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:237)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.intercept(GrapheneContextualHandler.java:263)
at org.jagdeep.example.arquillian.google.page.GooglePage$$EnhancerByGraphene$$9897962b.goTo(<generated>)
at org.jagdeep.example.arquillian.google.tests.GoogleTest1.f(GoogleTest1.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:230)
at org.jboss.arquillian.testng.Arquillian$2.invoke(Arquillian.java:145)
at org.jboss.arquillian.testng.standalone.LocalTestMethodExecutor.execute(LocalTestMethodExecutor.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:139)
at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:138)
at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:242)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:579)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
]]>

maven dep tree:

[INFO] org.jagdeep.example:arquillian-ui-test:jar:1.0-SNAPSHOT
[INFO] +- com.google.guava:guava:jar:23.0:test
[INFO] |  +- com.google.code.findbugs:jsr305:jar:1.3.9:test
[INFO] |  +- com.google.errorprone:error_prone_annotations:jar:2.0.18:test
[INFO] |  +- com.google.j2objc:j2objc-annotations:jar:1.1:test
[INFO] |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:test
[INFO] +- org.jboss.arquillian.graphene:graphene-webdriver:pom:2.3.2:compile
[INFO] |  +- org.jboss.arquillian.graphene:graphene-webdriver-api:jar:2.3.2:compile
[INFO] |  +- org.jboss.arquillian.graphene:graphene-webdriver-spi:jar:2.3.2:compile
[INFO] |  |  \- org.jboss.arquillian.core:arquillian-core-spi:jar:1.1.13.Final:compile
[INFO] |  +- org.jboss.arquillian.graphene:graphene-webdriver-impl:jar:2.3.2:compile
[INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-impl:jar:2.5.1:compile
[INFO] |  |  |  \- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.1.15.Final:compile
[INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-configuration:jar:2.5.1:compile
[INFO] |  |  +- cglib:cglib-nodep:jar:3.2.5:compile
[INFO] |  |  +- org.objenesis:objenesis:jar:1.2:compile
[INFO] |  |  +- org.jboss.arquillian.config:arquillian-config-api:jar:1.1.13.Final:compile
[INFO] |  |  |  \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0-alpha-10:compile
[INFO] |  |  +- org.jboss.arquillian.container:arquillian-container-spi:jar:1.1.13.Final:compile
[INFO] |  |  |  \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.2.6:compile
[INFO] |  |  \- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.1.13.Final:compile
[INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-webdriver-depchain:pom:2.5.1:compile
[INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-api:jar:2.5.1:compile
[INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-spi:jar:2.5.1:compile
[INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-webdriver:jar:2.5.1:runtime
[INFO] |  |  |  +- org.arquillian.spacelift:arquillian-spacelift:jar:1.0.2:runtime
[INFO] |  |  |  |  +- org.arquillian.spacelift:arquillian-spacelift-api:jar:1.0.2:runtime
[INFO] |  |  |  |  \- org.apache.commons:commons-compress:jar:1.8.1:runtime
[INFO] |  |  |  +- commons-io:commons-io:jar:2.5:compile
[INFO] |  |  |  +- org.jsoup:jsoup:jar:1.8.3:runtime
[INFO] |  |  |  \- org.awaitility:awaitility:jar:3.0.0:runtime
[INFO] |  |  |     +- org.hamcrest:hamcrest-library:jar:1.3:runtime
[INFO] |  |  |     \- org.hamcrest:hamcrest-core:jar:1.3:runtime
[INFO] |  |  +- org.seleniumhq.selenium:selenium-api:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-support:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-remote-driver:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:htmlunit-driver:jar:2.28:compile
[INFO] |  |  |  \- net.sourceforge.htmlunit:htmlunit:jar:2.28:compile
[INFO] |  |  |     +- xalan:xalan:jar:2.7.2:compile
[INFO] |  |  |     |  \- xalan:serializer:jar:2.7.2:compile
[INFO] |  |  |     +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] |  |  |     +- org.apache.commons:commons-text:jar:1.1:compile
[INFO] |  |  |     +- org.apache.httpcomponents:httpmime:jar:4.5.3:compile
[INFO] |  |  |     +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.28:compile
[INFO] |  |  |     +- net.sourceforge.htmlunit:neko-htmlunit:jar:2.28:compile
[INFO] |  |  |     |  \- xerces:xercesImpl:jar:2.11.0:compile
[INFO] |  |  |     |     \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] |  |  |     +- net.sourceforge.cssparser:cssparser:jar:0.9.24:compile
[INFO] |  |  |     |  \- org.w3c.css:sac:jar:1.3:compile
[INFO] |  |  |     +- commons-net:commons-net:jar:3.6:compile
[INFO] |  |  |     \- org.eclipse.jetty.websocket:websocket-client:jar:9.4.7.v20170914:compile
[INFO] |  |  |        +- org.eclipse.jetty:jetty-client:jar:9.4.7.v20170914:compile
[INFO] |  |  |        |  \- org.eclipse.jetty:jetty-http:jar:9.4.7.v20170914:compile
[INFO] |  |  |        +- org.eclipse.jetty:jetty-xml:jar:9.4.7.v20170914:compile
[INFO] |  |  |        +- org.eclipse.jetty:jetty-util:jar:9.4.7.v20170914:compile
[INFO] |  |  |        +- org.eclipse.jetty:jetty-io:jar:9.4.7.v20170914:compile
[INFO] |  |  |        \- org.eclipse.jetty.websocket:websocket-common:jar:9.4.7.v20170914:compile
[INFO] |  |  |           \- org.eclipse.jetty.websocket:websocket-api:jar:9.4.7.v20170914:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-opera-driver:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:3.11.0:compile
[INFO] |  |  +- org.seleniumhq.selenium:selenium-edge-driver:jar:3.11.0:compile
[INFO] |  |  \- com.codeborne:phantomjsdriver:jar:1.4.1:compile
[INFO] |  \- org.seleniumhq.selenium:selenium-java:jar:3.11.0:compile
[INFO] |     +- net.bytebuddy:byte-buddy:jar:1.7.9:compile
[INFO] |     +- org.apache.commons:commons-exec:jar:1.3:compile
[INFO] |     +- commons-codec:commons-codec:jar:1.10:compile
[INFO] |     +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |     +- com.google.code.gson:gson:jar:2.8.2:compile
[INFO] |     +- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
[INFO] |     +- org.apache.httpcomponents:httpcore:jar:4.4.6:compile
[INFO] |     +- com.squareup.okhttp3:okhttp:jar:3.9.1:compile
[INFO] |     \- com.squareup.okio:okio:jar:1.13.0:compile
[INFO] +- org.jboss.arquillian.testng:arquillian-testng-standalone:jar:1.7.0.Alpha2:compile
[INFO] |  +- org.jboss.arquillian.testng:arquillian-testng-core:jar:1.7.0.Alpha2:compile
[INFO] |  +- org.jboss.arquillian.test:arquillian-test-spi:jar:1.7.0.Alpha2:compile
[INFO] |  |  \- org.jboss.arquillian.test:arquillian-test-api:jar:1.7.0.Alpha2:compile
[INFO] |  +- org.jboss.arquillian.core:arquillian-core-impl-base:jar:1.7.0.Alpha2:compile
[INFO] |  |  \- org.jboss.arquillian.core:arquillian-core-api:jar:1.7.0.Alpha2:compile
[INFO] |  +- org.jboss.arquillian.test:arquillian-test-impl-base:jar:1.7.0.Alpha2:compile
[INFO] |  \- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.7.0.Alpha2:compile
[INFO] |     +- org.jboss.arquillian.config:arquillian-config-spi:jar:1.7.0.Alpha2:compile
[INFO] |     \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0:compile
[INFO] \- org.testng:testng:jar:6.14.3:test
[INFO]    +- com.beust:jcommander:jar:1.72:test
[INFO]    \- org.apache-extras.beanshell:bsh:jar:2.0b6:test
@jagdeepjain jagdeepjain changed the title https://github.com/jagdeepjain/webdriver-arquillian-test java.lang.IllegalStateException: The Graphene runtime isn't initialized. Aug 2, 2020
@lprimak
Copy link
Contributor

lprimak commented Oct 16, 2020

I am getting an exact same issue in a different project

@lprimak
Copy link
Contributor

lprimak commented Dec 7, 2020

I think this has been fixed with the latest Arquillian Alpha

@jagdeepjain
Copy link
Author

jagdeepjain commented Feb 8, 2021

@lprimak I can take a quick look at it, which maven dependency you are suggesting to update to Alpha? Is it Graphene?
This is the snippet from pom.xml I have currently.

  <dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>1.7.0.Alpha2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-bom</artifactId>
            <version>2.5.1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.jboss.arquillian.graphene</groupId>
        <artifactId>graphene-webdriver</artifactId>
        <version>2.3.2</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.testng</groupId>
        <artifactId>arquillian-testng-standalone</artifactId>
        <version>1.7.0.Alpha2</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
        <scope>test</scope>
    </dependency>
</dependencies>

@lprimak
Copy link
Contributor

lprimak commented Feb 8, 2021

@jagdeepjain no, just update Arquillian to the latest alpha (Alpha7 now)
Also, Selenium 3.13.0 is what I used.
Also JUnit not testNG (JUnit 5) (not sure what is consequential out of these)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants