4 Replies Latest reply on Mar 6, 2014 4:23 AM by kpiwko

    Graphene + JBehave

    kwintesencja

      Hi Everyone,

       

      i have a project with  arquillian + jbehave extension working for my integration tests. Now i want do use BDD for my functional tests

       

      I know that JBehave extension is not officially released yet but maybe you can figure it out looking at the stacktrace.

       

      I'm running my tests with testable=false and got WebDriver and URL successfully injected in my steps but as soon i invoke driver.get i got the following exception :

       

      org.openqa.selenium.WebDriverException: f.QueryInterface is not a function

      Command duration or timeout: 18 milliseconds

      Build info: version: '2.37.1', revision: 'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-21 09:08:07'

      System info: host: 'rmpestano-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-58-generic-pae', java.version: '1.7.0_09'

      Session ID: c97b8b86-241e-4875-b600-c64b0b609b8b

      Driver info: org.openqa.selenium.firefox.FirefoxDriver

      Capabilities [{platform=LINUX, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=26.0}]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

          at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

          at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)

          at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)

          at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)

          at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:130)

          at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$1.invoke(GrapheneContextualHandler.java:159)

          at org.jboss.arquillian.graphene.enricher.SearchContextInterceptor.intercept(SearchContextInterceptor.java:50)

          at org.jboss.arquillian.graphene.proxy.InvocationContextImpl.invoke(InvocationContextImpl.java:87)

          at org.jboss.arquillian.graphene.enricher.StaleElementInterceptor$1.apply(StaleElementInterceptor.java:48)

          at org.jboss.arquillian.graphene.enricher.StaleElementInterceptor$1.apply(StaleElementInterceptor.java:44)

          at org.openqa.selenium.support.ui.FluentWait$1.apply(FluentWait.java:177)

          at org.openqa.selenium.support.ui.FluentWait$1.apply(FluentWait.java:175)

          at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)

          at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:175)

          at org.jboss.arquillian.graphene.wait.WebDriverWaitImpl.until(WebDriverWaitImpl.java:87)

          at org.jboss.arquillian.graphene.enricher.StaleElementInterceptor.intercept(StaleElementInterceptor.java:44)

          at org.jboss.arquillian.graphene.proxy.InvocationContextImpl.invoke(InvocationContextImpl.java:87)

          at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$2.call(GrapheneContextualHandler.java:209)

          at org.jboss.arquillian.graphene.context.BrowserActions.performAction(BrowserActions.java:62)

          at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:205)

          at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.intercept(GrapheneContextualHandler.java:229)

          at org.openqa.selenium.firefox.FirefoxDriver$$EnhancerByGraphene$$c11f5cc4.get(<generated>)

          at com.procergs.test.jbehave.inscricao.InscricaoPesquisarSteps.dadoUmaTurma(InscricaoPesquisarSteps.java:57)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:537)

          at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:477)

          at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:457)

          at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:421)

          at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:297)

          at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:211)

          at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:172)

          at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)

          at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

          at java.util.concurrent.FutureTask.run(FutureTask.java:166)

          at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)

          at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132)

          at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58)

          at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)

          at org.jbehave.core.embedder.StoryManager.submit(StoryManager.java:198)

          at org.jbehave.core.embedder.StoryManager.runningStory(StoryManager.java:132)

          at org.jbehave.core.embedder.StoryManager.filterRunning(StoryManager.java:116)

          at org.jbehave.core.embedder.StoryManager.runningStoriesAsPaths(StoryManager.java:101)

          at org.jbehave.core.embedder.StoryManager.runStories(StoryManager.java:78)

          at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:202)

          at org.jbehave.core.junit.JUnitStory.run(JUnitStory.java:24)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

          at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)

          at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:53)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:102)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

          at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)

          at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

          at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: f.QueryInterface is not a function

      Build info: version: '2.37.1', revision: 'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-21 09:08:07'

      System info: host: 'rmpestano-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'i386', os.version: '3.2.0-58-generic-pae', java.version: '1.7.0_09'

      Driver info: driver.version: unknown

          at <anonymous class>.FirefoxDriver.prototype.get(file:///tmp/anonymous7275162044738017611webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js:8751)

          at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///tmp/anonymous7275162044738017611webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10844)

          at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///tmp/anonymous7275162044738017611webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10849)

          at <anonymous class>.DelayedCommand.prototype.execute/<(file:///tmp/anonymous7275162044738017611webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10791)

       

      Any help is welcome.

        • 1. Re: Graphene + JBehave
          kpiwko

          Hi Rafael,

           

          I believe this is caused by using Firefox 26 with Selenium 2.37.1, as this is not supported combination, see http://selenium.googlecode.com/git/java/CHANGELOG.

           

          The issue should be fixed by either:

          1/ using another browser, such as Chrome, see Drone - Arquillian - Project Documentation Editor for supported browsers

          2/ updating Selenium to 2.39.0, see How do I specify the Selenium version in Arquillian Drone? if insure how to do that

          3/ updating Drone to 1.2.3.Final, which already contains 2.39.0

           

          I recommend 3/ as the easiest approach.

           

          Karel

          1 of 1 people found this helpful
          • 2. Re: Graphene + JBehave
            kwintesencja

            Hi Karel,

             

            thanks for the answer but the problem was related to another issue, to make it work i had to open webbrowser in the class which creates the deployment(@Deployment) and later in the steps everything worked fine. I can execute as many jbahave scenarios i want but i have to keep browser opened, if i close browser during steps and try to open it again i receive:

            Caused by: java.lang.RuntimeException: org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.

             

            here is a simple logon example with two scenarios:

             

            logon.story

             

            Story: Given that i'm on logon screen

                    i want to logon with users

                    so i can verify logon routine is working

             

             

            Scenario: should logon successfully with a user with valid credentials

             

            Given user is at logon screen

             

            When he types username user1 and password right_pass

             

            Then logged in = true

             

            Scenario: should not logon using invalid credentials

             

            Given user is at logon screen

             

            When he types username user1 and password wrong_pass

             

            Then logged in = false

             

            LogonStory.java

             

            @Steps(LogonSteps.class)

            @RunWith(Arquillian.class)

            public class LogonStory extends BaseFunctionalBehaveTest {

              

                @Drone

                protected WebDriver browser;

             

                @ArquillianResource

                protected URL baseUrl;

             

             

                @Deployment(testable = false)

                public static WebArchive createDeployment()

                {

                    WebArchive archive = createBaseDeployment()

                            .addPackage("org.jboss.arquillian.jbehave.domain")

                            .addPackages(true, "com.procergs.test.jbehave")

                            .addAsResource("com/procergs/test/jbehave/logon/logon.story");

                    MavenResolverSystem resolver = Maven.resolver();

                    archive.addAsLibraries(resolver.loadPomFromFile("pom.xml").resolve("com.google.guava:guava:11.0.1").withoutTransitivity().asFile());

                    archive.addAsLibraries(resolver.loadPomFromFile("pom.xml").resolve("org.jbehave:jbehave-core:3.7.5").withTransitivity().asFile());

                    return archive;

                }

              

              

                @Test

                public void initWebdriver(){

                   browser.get(baseUrl.toString());//needed to open browser

                }

             

            }

             

            the superclass only adds web related packages such as managedBeans and web related resources as pages, css js etc. It also extends BaseBehaveTest which initializes steps as follows:

             

               @Override

                public InjectableStepsFactory stepsFactory()

                {

                    return new ArquillianInstanceStepsFactory(configuration(), getSteps());

                }

             

             

                private Object[] getSteps(){

                    if(getClass().isAnnotationPresent(Steps.class)){

                        if(steps == null){

                            steps = initializeSteps();

                        }

                        return steps;

                    }

                    else{

                        throw new RuntimeException("provide steps annotation to run jbehave tests");

                    }

                }

             

                private Object[] initializeSteps() {

                    Class[] stepsCandidates = getClass().getAnnotation(Steps.class).value();

                    steps = new Object[stepsCandidates.length];

                    for (int i = 0;i< stepsCandidates.length;i++) {

                        try {

                            steps[i] = stepsCandidates[i].newInstance();

                        } catch (InstantiationException | IllegalAccessException e) {

                            // TODO Auto-generated catch block

                            e.printStackTrace();

                        }

                    }

                    return steps;

                }

             

            and finally the LogonSteps.java which executes the two scenarios in the logon.story

             

            public class LogonSteps extends BaseStep implements Serializable {

             

                @ArquillianResource URL url;

              

                @Drone

                WebDriver driver;

             

                @Page

                LogonPage logonPage;

             

                @Page

                IndexPage indexPage;

             

                @FindByJQuery("button[id$=logout]")

                protected GrapheneElement logoutButton;

             

                @Given("user is at logon screen")

                public void givenUserIsAtLogon(){

                    /*when executing this scenario for the first time

                   user will be at logon screen but in subsequent executions

                   it will be looged out via logout button

                    */

                    if(logoutButton.isPresent()){

                       //user already loggedin, do logout

                       guardHttp(logoutButton).click();

                    }

                }

             

                @When("he types username $username and password $password")

                public void whenUserTypesUsernameAndPass(String username, String password) {

                        logonPage.logon(username, password);

                }

             

                @Then("logged in = $expected")

                public void loggedIn(String expected){

                     //index page will be present in scenario 1 so expected will be true

                     //index page will not be present in scenario 2 so expected  will be false

                    Assert.assertTrue(indexPage.getTitle().isPresent().equals(Boolean.valueOf(expected)));

                }

               

              

            }

             

            Something to note:

             

            in server log i get errors about classnotfounds such as Caused by: java.lang.NoClassDefFoundError: Lorg/openqa/selenium/WebDriver; or srinkwrap, but has no interference in test result. To get ride of the exceptions just add those classes in the arquillian deployment.

             

            At our company acceptance criteria are usually "black boxed" and written based on UI so jbehave + graphene is the perfect combination for that. I hope jbehave extension will be released soon with graphene/drone support. Keep the great work!

             

            my dependency tree is below:

             

            [INFO] com.procergs.apm:apm-arq4:war:0.9.10

            [INFO] +- org.hibernate:hibernate-core:jar:4.1.3.Final:provided

            [INFO] |  +- antlr:antlr:jar:2.7.7:provided

            [INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:provided

            [INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:provided

            [INFO] |  +- dom4j:dom4j:jar:1.6.1:provided

            [INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:provided

            [INFO] |  +- org.javassist:javassist:jar:3.15.0-GA:provided

            [INFO] |  \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:provided

            [INFO] +- org.jboss.resteasy:resteasy-jackson-provider:jar:2.3.5.Final:test

            [INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.9:test

            [INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.9:test

            [INFO] |  \- org.codehaus.jackson:jackson-xc:jar:1.9.9:test

            [INFO] +- org.jboss.resteasy:resteasy-jaxrs:jar:2.3.3.FINAL:test

            [INFO] |  +- org.jboss.resteasy:jaxrs-api:jar:2.3.3.Final:test

            [INFO] |  +- org.scannotation:scannotation:jar:1.0.3:test

            [INFO] |  |  \- javassist:javassist:jar:3.12.1.GA:test

            [INFO] |  +- javax.annotation:jsr250-api:jar:1.0:test

            [INFO] |  +- javax.activation:activation:jar:1.1:provided

            [INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:test

            [INFO] |  |  \- commons-codec:commons-codec:jar:1.2:test

            [INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.1.2:test

            [INFO] |  \- net.jcip:jcip-annotations:jar:1.0:test

            [INFO] +- org.jboss.resteasy:resteasy-multipart-provider:jar:2.3.3.Final:provided

            [INFO] |  +- javax.mail:mail:jar:1.4.4:provided

            [INFO] |  +- org.apache.james:apache-mime4j:jar:0.6:provided

            [INFO] |  \- javax.servlet:servlet-api:jar:2.5:provided

            [INFO] +- org.codehaus.jackson:jackson-core-asl:jar:1.5.5:provided

            [INFO] +- org.jboss.resteasy:resteasy-jaxb-provider:jar:2.3.3.Final:provided

            [INFO] |  \- com.sun.xml.bind:jaxb-impl:jar:2.2.4:provided

            [INFO] |     \- javax.xml.bind:jaxb-api:jar:2.2.3:provided

            [INFO] |        \- javax.xml.stream:stax-api:jar:1.0-2:provided

            [INFO] +- com.google.code.gson:gson:jar:2.2.4:compile

            [INFO] +- com.procergs.acr:prarqjava4:jar:0.9.10:compile

            [INFO] |  +- com.procergs.sca:sca-ws:jar:1.0.2:compile

            [INFO] |  \- com.procergs.det:detcredenciadows:jar:1.0.1:compile

            [INFO] +- com.procergs.acr:PRSoeweb:jar:4.1.0:provided

            [INFO] +- com.acrs:PRAssinador-WS-Client:jar:2.0.1:compile

            [INFO] |  \- log4j:log4j:jar:1.2.13:compile

            [INFO] +- org.primefaces:primefaces:jar:4.0.5:compile

            [INFO] +- org.primefaces.extensions:all-themes:jar:1.0.8:compile

            [INFO] |  +- org.primefaces.themes:afterdark:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:afternoon:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:afterwork:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:black-tie:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:blitzer:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:bluesky:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:bootstrap:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:casablanca:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:cruze:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:cupertino:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:dark-hive:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:dot-luv:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:eggplant:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:excite-bike:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:flick:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:glass-x:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:hot-sneaks:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:humanity:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:le-frog:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:midnight:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:mint-choc:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:overcast:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:pepper-grinder:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:redmond:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:rocket:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:sam:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:smoothness:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:south-street:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:start:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:sunny:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:swanky-purse:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:trontastic:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:ui-darkness:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:ui-lightness:jar:1.0.8:runtime

            [INFO] |  +- org.primefaces.themes:vader:jar:1.0.8:runtime

            [INFO] |  \- org.primefaces.themes:home:jar:1.0.8:runtime

            [INFO] +- org.primefaces.extensions:primefaces-extensions:jar:1.0.0:compile

            [INFO] |  \- org.apache.commons:commons-lang3:jar:3.1:compile

            [INFO] +- org.omnifaces:omnifaces:jar:1.6:compile

            [INFO] +- org.apache.myfaces.extensions.cdi.bundles:myfaces-extcdi-bundle-jsf20:jar:1.0.5:compile

            [INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile

            [INFO] +- commons-io:commons-io:jar:1.3.2:compile

            [INFO] +- org.slf4j:slf4j-api:jar:1.6.1:provided

            [INFO] +- net.bull.javamelody:javamelody-core:jar:1.49.0:compile

            [INFO] |  \- org.jrobin:jrobin:jar:1.5.9:compile

            [INFO] +- net.sf.jasperreports:jasperreports:jar:5.1.2:compile

            [INFO] |  +- commons-beanutils:commons-beanutils:jar:1.8.0:compile

            [INFO] |  +- commons-digester:commons-digester:jar:2.1:compile

            [INFO] |  +- commons-logging:commons-logging:jar:1.1.1:compile

            [INFO] |  +- jfree:jcommon:jar:1.0.15:compile

            [INFO] |  +- jfree:jfreechart:jar:1.0.12:compile

            [INFO] |  +- eclipse:jdtcore:jar:3.1.0:compile

            [INFO] |  +- org.codehaus.castor:castor:jar:1.2:compile

            [INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.0.5:compile

            [INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.0.5:compile

            [INFO] |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.0.5:compile

            [INFO] +- com.lowagie:itext:jar:2.1.7:compile

            [INFO] |  +- bouncycastle:bcmail-jdk14:jar:138:compile

            [INFO] |  +- bouncycastle:bcprov-jdk14:jar:138:compile

            [INFO] |  \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile

            [INFO] |     +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile

            [INFO] |     \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile

            [INFO] +- junit:junit:jar:4.8.2:test

            [INFO] +- org.jboss.arquillian.junit:arquillian-junit-container:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.junit:arquillian-junit-core:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.test:arquillian-test-api:jar:1.1.3.Final:test

            [INFO] |  |  \- org.jboss.arquillian.core:arquillian-core-api:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.test:arquillian-test-spi:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.1.3.Final:test

            [INFO] |  |  \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.2.1:test

            [INFO] |  +- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.core:arquillian-core-impl-base:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.test:arquillian-test-impl-base:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.container:arquillian-container-impl-base:jar:1.1.3.Final:test

            [INFO] |  |  +- org.jboss.arquillian.config:arquillian-config-api:jar:1.1.3.Final:test

            [INFO] |  |  \- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.container:arquillian-container-test-impl-base:jar:1.1.3.Final:test

            [INFO] |  \- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.2.1:test

            [INFO] |     \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.2.1:test

            [INFO] +- org.jboss.arquillian.extension:arquillian-persistence-api:jar:1.0.0.Alpha6:test

            [INFO] +- org.jboss.arquillian.extension:arquillian-persistence-impl:jar:1.0.0.Alpha6:test

            [INFO] |  +- org.jboss.arquillian.extension:arquillian-transaction-spi:jar:1.0.0.Alpha3:test

            [INFO] |  |  \- org.jboss.arquillian.extension:arquillian-transaction-api:jar:1.0.0.Alpha3:test

            [INFO] |  +- org.jboss.arquillian.extension:arquillian-transaction-jta:jar:1.0.0.Alpha3:test

            [INFO] |  |  \- org.jboss.arquillian.extension:arquillian-transaction-impl-base:jar:1.0.0.Alpha3:test

            [INFO] |  +- org.dbunit:dbunit:jar:2.4.9:test

            [INFO] |  +- org.yaml:snakeyaml:jar:1.10:test

            [INFO] |  +- org.apache.poi:poi:jar:3.2-FINAL:test

            [INFO] |  \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0-alpha-5:test

            [INFO] +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain:pom:2.0.2:test

            [INFO] |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:jar:2.0.2:test

            [INFO] |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi:jar:2.0.2:test

            [INFO] |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:jar:2.0.2:test

            [INFO] |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven:jar:2.0.2:test

            [INFO] |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:2.0.2:test

            [INFO] |  |  +- org.sonatype.aether:aether-api:jar:1.13.1:test

            [INFO] |  |  +- org.sonatype.aether:aether-impl:jar:1.13.1:test

            [INFO] |  |  +- org.sonatype.aether:aether-spi:jar:1.13.1:test

            [INFO] |  |  +- org.sonatype.aether:aether-util:jar:1.13.1:test

            [INFO] |  |  +- org.sonatype.aether:aether-connector-wagon:jar:1.13.1:test

            [INFO] |  |  +- org.apache.maven:maven-aether-provider:jar:3.0.5:test

            [INFO] |  |  +- org.apache.maven:maven-model:jar:3.0.5:test

            [INFO] |  |  +- org.apache.maven:maven-model-builder:jar:3.0.5:test

            [INFO] |  |  +- org.apache.maven:maven-repository-metadata:jar:3.0.5:test

            [INFO] |  |  +- org.apache.maven:maven-settings:jar:3.0.5:test

            [INFO] |  |  +- org.apache.maven:maven-settings-builder:jar:3.0.5:test

            [INFO] |  |  +- org.codehaus.plexus:plexus-interpolation:jar:1.14:test

            [INFO] |  |  +- org.codehaus.plexus:plexus-utils:jar:2.0.6:test

            [INFO] |  |  +- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:test

            [INFO] |  |  |  \- org.sonatype.plexus:plexus-cipher:jar:1.4:test

            [INFO] |  |  +- org.apache.maven.wagon:wagon-provider-api:jar:2.4:test

            [INFO] |  |  +- org.apache.maven.wagon:wagon-file:jar:2.4:test

            [INFO] |  |  \- org.apache.maven.wagon:wagon-http-lightweight:jar:2.4:test

            [INFO] |  |     \- org.apache.maven.wagon:wagon-http-shared4:jar:2.4:test

            [INFO] |  |        \- org.jsoup:jsoup:jar:1.7.1:test

            [INFO] |  \- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven-archive:jar:2.0.2:test

            [INFO] |     +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven-archive:jar:2.0.2:test

            [INFO] |     +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven-archive:jar:2.0.2:test

            [INFO] |     +- org.codehaus.plexus:plexus-compiler-javac:jar:2.1:test

            [INFO] |     |  \- org.codehaus.plexus:plexus-compiler-api:jar:2.1:test

            [INFO] |     \- org.codehaus.plexus:plexus-component-api:jar:1.0-alpha-33:test

            [INFO] |        \- org.codehaus.plexus:plexus-classworlds:jar:1.2-alpha-10:test

            [INFO] +- org.jboss.arquillian.graphene:graphene-webdriver:pom:2.0.1.Final:test

            [INFO] |  +- org.jboss.arquillian.graphene:graphene-webdriver-api:jar:2.0.1.Final:test

            [INFO] |  +- org.jboss.arquillian.graphene:graphene-webdriver-spi:jar:2.0.1.Final:test

            [INFO] |  +- org.jboss.arquillian.graphene:graphene-webdriver-impl:jar:2.0.1.Final:test

            [INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-impl:jar:1.2.4.Final:test

            [INFO] |  |  \- org.jboss.arquillian.extension:arquillian-drone-configuration:jar:1.2.4.Final:test

            [INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-webdriver-depchain:pom:1.2.4.Final:test

            [INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-api:jar:1.2.4.Final:test

            [INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-spi:jar:1.2.4.Final:test

            [INFO] |  |  +- org.jboss.arquillian.extension:arquillian-drone-webdriver:jar:1.2.4.Final:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-api:jar:2.39.0:test

            [INFO] |  |  |  +- com.google.guava:guava:jar:15.0:test

            [INFO] |  |  |  \- org.json:json:jar:20080701:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-support:jar:2.39.0:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-android-driver:jar:2.39.0:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.39.0:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.39.0:test

            [INFO] |  |  |  \- org.apache.commons:commons-exec:jar:1.1:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.39.0:test

            [INFO] |  |  |  \- net.sourceforge.htmlunit:htmlunit:jar:2.13:test

            [INFO] |  |  |     +- xalan:xalan:jar:2.7.1:test

            [INFO] |  |  |     |  \- xalan:serializer:jar:2.7.1:test

            [INFO] |  |  |     +- org.apache.httpcomponents:httpmime:jar:4.3.1:test

            [INFO] |  |  |     +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.13:test

            [INFO] |  |  |     +- xerces:xercesImpl:jar:2.11.0:test

            [INFO] |  |  |     +- net.sourceforge.nekohtml:nekohtml:jar:1.9.19:test

            [INFO] |  |  |     +- net.sourceforge.cssparser:cssparser:jar:0.9.11:test

            [INFO] |  |  |     |  \- org.w3c.css:sac:jar:1.3:test

            [INFO] |  |  |     \- org.eclipse.jetty:jetty-websocket:jar:8.1.12.v20130726:test

            [INFO] |  |  |        +- org.eclipse.jetty:jetty-util:jar:8.1.12.v20130726:test

            [INFO] |  |  |        +- org.eclipse.jetty:jetty-io:jar:8.1.12.v20130726:test

            [INFO] |  |  |        \- org.eclipse.jetty:jetty-http:jar:8.1.12.v20130726:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.39.0:test

            [INFO] |  |  |  +- net.java.dev.jna:jna:jar:3.4.0:test

            [INFO] |  |  |  \- net.java.dev.jna:platform:jar:3.4.0:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.39.0:test

            [INFO] |  |  +- org.seleniumhq.selenium:selenium-remote-driver:jar:2.39.0:test

            [INFO] |  |  |  \- cglib:cglib-nodep:jar:2.1_3:test

            [INFO] |  |  \- com.opera:operadriver:jar:1.5:test

            [INFO] |  |     +- com.opera:operalaunchers:jar:1.1:test

            [INFO] |  |     +- com.google.protobuf:protobuf-java:jar:2.4.1:test

            [INFO] |  |     +- commons-jxpath:commons-jxpath:jar:1.3:test

            [INFO] |  |     \- org.ini4j:ini4j:jar:0.5.2:test

            [INFO] |  \- org.seleniumhq.selenium:selenium-java:jar:2.39.0:test

            [INFO] |     +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.39.0:test

            [INFO] |     \- org.webbitserver:webbit:jar:0.4.14:test

            [INFO] |        \- io.netty:netty:jar:3.5.2.Final:test

            [INFO] +- org.jboss.arquillian.extension:arquillian-phantom-driver:jar:1.1.0.Final:test

            [INFO] |  \- com.github.detro.ghostdriver:phantomjsdriver:jar:1.1.0:test

            [INFO] |     \- org.seleniumhq.selenium:selenium-server:jar:2.39.0:test

            [INFO] |        +- org.bouncycastle:bcprov-jdk15on:jar:1.48:test

            [INFO] |        +- org.bouncycastle:bcpkix-jdk15on:jar:1.48:test

            [INFO] |        +- mx4j:mx4j-tools:jar:3.0.1:test

            [INFO] |        +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.9:test

            [INFO] |        \- org.seleniumhq.selenium:jetty-repacked:jar:7.6.1:test

            [INFO] +- org.jboss.arquillian.jbehave:arquillian-jbehave-core:jar:1.0.2:test

            [INFO] |  +- org.jboss.arquillian.core:arquillian-core-spi:jar:1.1.3.Final:test

            [INFO] |  +- org.jbehave:jbehave-core:zip:resources:3.7:test

            [INFO] |  |  +- junit:junit-dep:jar:4.8.2:test

            [INFO] |  |  +- org.hamcrest:hamcrest-core:jar:1.1:test

            [INFO] |  |  +- org.hamcrest:hamcrest-library:jar:1.1:test

            [INFO] |  |  +- org.hamcrest:hamcrest-integration:jar:1.1:test

            [INFO] |  |  +- commons-lang:commons-lang:jar:2.5:test

            [INFO] |  |  +- org.freemarker:freemarker:jar:2.3.16:test

            [INFO] |  |  +- com.thoughtworks.paranamer:paranamer:jar:2.4:test

            [INFO] |  |  \- com.thoughtworks.xstream:xstream:jar:1.3.1:test

            [INFO] |  |     \- xpp3:xpp3_min:jar:1.1.4c:test

            [INFO] |  +- org.jbehave:jbehave-core:jar:3.7:test

            [INFO] |  \- org.jbehave.site:jbehave-site-resources:zip:3.1.1:test

            [INFO] +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.1.Final:test

            [INFO] +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.2.Final:test

            [INFO] +- org.jboss.arquillian.protocol:arquillian-protocol-servlet:jar:1.1.3.Final:test

            [INFO] |  +- org.jboss.arquillian.container:arquillian-container-spi:jar:1.1.3.Final:test

            [INFO] |  \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0-alpha-5:test

            [INFO] |     \- org.easytesting:fest-assert:jar:1.4:test

            [INFO] |        \- org.easytesting:fest-util:jar:1.1.6:test

            [INFO] +- org.apache.httpcomponents:httpcore:jar:4.2.5:test

            [INFO] +- commons-collections:commons-collections:jar:3.2.1:compile

            [INFO] +- xml-apis:xml-apis:jar:1.4.01:test

            [INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.5:test

            [INFO] \- javax:javaee-api:jar:6.0:provided

            • 3. Re: Graphene + JBehave
              kwintesencja

              A small update,

               

              there is no need to open webbrowser in LogonStory.java,  it just needs to be injected there:

               

              @Steps(LogonSteps.class)

              @RunWith(Arquillian.class)

              public class LogonStory extends BaseFunctionalBehaveTest {

                 

                  @Drone

                  protected WebDriver browser;

               

              ....

               

              initWebBrowser method is not needed anymore and you can open webbrowser in LogonStep.java:

               

                 @Given("user is at logon screen")

                  public void givenUserIsAtLogon(){

                      if(logoutButton.isPresent()){

                         //user already loggedin, do logout

                         guardHttp(logoutButton).click();

                      }

                      else{

                        browser.get(url.toString());

                     }

                  }

               

               

              if WebDriver is not injected in LogonStory(the class with the @RunWith(Arquillian.class) then the following exception is thrown in LogonStep:

               

              java.lang.IllegalArgumentException: Retrieved a null from context, which is not a valid Drone browser object

                  at org.jboss.arquillian.drone.impl.Validate.notNull(Validate.java:42)

                  at org.jboss.arquillian.drone.impl.DroneTestEnricher.getDroneInstance(DroneTestEnricher.java:110)

                  at org.jboss.arquillian.drone.impl.DroneTestEnricher.enrich(DroneTestEnricher.java:75)

                  at org.jboss.arquillian.jbehave.core.ArquillianInstanceStepsFactory.createInstanceOfType(ArquillianInstanceStepsFactory.java:55)

                  at org.jbehave.core.steps.StepCreator.stepsInstance(StepCreator.java:79)

                  at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:537)

                  at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:477)

                  at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:457)

                  at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:421)

                  at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:297)

                  at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:211)

                  at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:172)

                  at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)

                  at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)

                  at java.util.concurrent.FutureTask.run(FutureTask.java:262)

                  at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)

                  at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132)

                  at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58)

                  at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:37)

                  at org.jbehave.core.embedder.StoryManager.submit(StoryManager.java:198)

                  at org.jbehave.core.embedder.StoryManager.runningStory(StoryManager.java:132)

                  at org.jbehave.core.embedder.StoryManager.filterRunning(StoryManager.java:116)

                  at org.jbehave.core.embedder.StoryManager.runningStoriesAsPaths(StoryManager.java:101)

                  at org.jbehave.core.embedder.StoryManager.runStories(StoryManager.java:78)

                  at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:202)

                  at org.jbehave.core.junit.JUnitStory.run(JUnitStory.java:24)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                  at java.lang.reflect.Method.invoke(Method.java:606)

                  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

                  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

              • 4. Re: Re: Graphene + JBehave
                kpiwko

                Hi Rafael,

                 

                thanks for the details. Commenting your notes:

                 

                in server log i get errors about classnotfounds such as Caused by: java.lang.NoClassDefFoundError: Lorg/openqa/selenium/WebDriver; or srinkwrap, but has no interference in test result. To get ride of the exceptions just add those classes in the arquillian deployment.

                 

                This looks like some code is executed InServer, instead of AsClient despite you indicate you want to run all test AsClient (via testable=false). This is likely a bug in JBehave.

                 

                if WebDriver is not injected in LogonStory(the class with the @RunWith(Arquillian.class) then the following exception is thrown in LogonStep:

                 

                java.lang.IllegalArgumentException: Retrieved a null from context, which is not a valid Drone browser object

                    at org.jboss.arquillian.drone.impl.Validate.notNull(Validate.java:42)

                    at org.jboss.arquillian.drone.impl.DroneTestEnricher.getDroneInstance(DroneTestEnricher.java:110)

                    at org.jboss.arquillian.drone.impl.DroneTestEnricher.enrich(DroneTestEnricher.java:75)

                    at org.jboss.arquillian.jbehave.core.ArquillianInstanceStepsFactory.createInstanceOfType(ArquillianInstanceStepsFactory.java:55)

                 

                I believe this is a bug in Drone - it does not provide a way for JBehave extension to force Drone setup in class that is not a test. So there is nothing to inject at time Step asks for Drone. This will be fixed with Drone 2.x, we at least provide a way how to better integrate with Drone or we make this scenario supported out of the box. It would be awesome if you could give Drone 2.0.0.Alpha1 a try once out to help us make usage more convenient.

                 

                Karel