[JBoss JIRA] (ARQGRA-454) NPE in WebElementEnricher.enrich() with Arquillian 1.1.5.Final
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-454?page=com.atlassian.jira.plugin... ]
Matous Jobanek commented on ARQGRA-454:
---------------------------------------
Hi,
this problem should be fixed with the newest version of Arquillian-core (1.1.11.Final).
Just small question - isn't there missing an injected @Drone Webdriver instance in the reproducers? Without that I get the expected exception {{ISE: There is no context available for qualifier.....}}, so just for verification...
> NPE in WebElementEnricher.enrich() with Arquillian 1.1.5.Final
> --------------------------------------------------------------
>
> Key: ARQGRA-454
> URL: https://issues.jboss.org/browse/ARQGRA-454
> Project: Arquillian Graphene
> Issue Type: Bug
> Components: core
> Affects Versions: 2.0.3.Final, 2.1.0.Alpha2
> Reporter: Juergen Zimmermann
> Assignee: Lukáš Fryč
> Fix For: 2.0.4.Final, 2.1-Tracking
>
>
> I'm getting a GrapheneTestEnricherException caused by a NPE (see stacktrace below) after upgrading Arquillian to 1.1.5.Final. The issue doesn't exist with Arquillian 1.1.4.Final.
> The stacktrace:
> {code}
> org.jboss.arquillian.graphene.enricher.exception.GrapheneTestEnricherException:
> Error while initializing: class de.shop.util.IndexPage
> at org.jboss.arquillian.graphene.location.LocationEnricher.goTo(LocationEnricher.java:78)
> at org.jboss.arquillian.graphene.DefaultGrapheneRuntime.goTo(DefaultGrapheneRuntime.java:125)
> at org.jboss.arquillian.graphene.DefaultGrapheneRuntime.goTo(DefaultGrapheneRuntime.java:120)
> at org.jboss.arquillian.graphene.Graphene.goTo(Graphene.java:291)
> at de.shop.util.AbstractWebTest.before(AbstractWebTest.java:54)
> 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:483)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:267)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:193)
> at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
> at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
> at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
> at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
> at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
> at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
> at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> Caused by: java.lang.NullPointerException
> at org.jboss.arquillian.graphene.enricher.WebElementEnricher.enrich(WebElementEnricher.java:68)
> at org.jboss.arquillian.graphene.enricher.AbstractSearchContextEnricher.enrichRecursively(AbstractSearchContextEnricher.java:73)
> at org.jboss.arquillian.graphene.enricher.PageObjectEnricher.setupPage(PageObjectEnricher.java:97)
> at org.jboss.arquillian.graphene.location.LocationEnricher.goTo(LocationEnricher.java:76)
> ... 34 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ARQ-2006) ISE for deployment-scoped drone point when manual deployment is used
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQ-2006?page=com.atlassian.jira.plugin.s... ]
Matous Jobanek closed ARQ-2006.
-------------------------------
> ISE for deployment-scoped drone point when manual deployment is used
> --------------------------------------------------------------------
>
> Key: ARQ-2006
> URL: https://issues.jboss.org/browse/ARQ-2006
> Project: Arquillian
> Issue Type: Bug
> Components: Extension - Drone
> Affects Versions: drone_2.0.0.Alpha5
> Reporter: Matous Jobanek
> Assignee: Matous Jobanek
> Fix For: drone_2.0.0.Beta1
>
>
> Consider these scenarios:
> 1)
> {code:java}
> @Deployment(name = "first", managed = false)
> public static Archive deployFirst() {
> return ShrinkWrap.create(WebArchive.class);
> }
> @Deployment(name = "second")
> public static WebArchive deploySecond() {
> return ShrinkWrap.create(WebArchive.class);
> }
> @ArquillianResource
> private Deployer deployer;
> @Drone
> @OperateOnDeployment("first")
> private WebDriver firstBrowser;
> @Drone
> @OperateOnDeployment("second")
> private WebDriver secondBrowser;
> @Test
> @InSequence(1)
> public void runFirstTest() throws InterruptedException {
> deployer.deploy("first");
> firstBrowser.get("http://google.com");
> deployer.undeploy("first");
> }
> @Test
> @InSequence(2)
> public void runSecondTest() throws InterruptedException {
> secondBrowser.get("http://google.com");
> }
> {code}
> 2)
> {code:java}
> @Deployment(name = "deployment", managed = false)
> public static Archive deployFirst() {
> return ShrinkWrap.create(WebArchive.class);
> }
> @ArquillianResource
> private Deployer deployer;
> @Drone
> @OperateOnDeployment("deployment")
> private WebDriver browser;
> @Test
> @InSequence(1)
> public void runFirstTest() throws InterruptedException {
> deployer.deploy("deployment");
> browser.get("http://google.com");
> deployer.undeploy("deployment");
> }
> @Test
> @InSequence(2)
> public void runSecondTest() throws InterruptedException {
> deployer.deploy("deployment");
> browser.get("http://google.com");
> deployer.undeploy("deployment");
> }
> {code}
> both of them lead to the IllegalStateException:
> {noformat}
> java.lang.IllegalStateException: Injection point DronePointImpl{droneClass=interface org.openqa.selenium.WebDriver, annotations=[(a)org.jboss.arquillian.drone.api.annotation.Drone(), @org.jboss.arquillian.container.test.api.OperateOnDeployment(value=deployment)], lifecycle=DEPLOYMENT} has deployment lifecycle and has to be prepared in @BeforeClass.
> at org.jboss.arquillian.drone.impl.DroneTestEnrichHelper.ensureInjectionPointPrepared(DroneTestEnrichHelper.java:104)
> at org.jboss.arquillian.drone.impl.DroneTestEnrichHelper.enrichTestClass(DroneTestEnrichHelper.java:72)
> at org.jboss.arquillian.drone.impl.DroneTestEnricher.enrich(DroneTestEnricher.java:54)
> ...
> {noformat}
> The cause: the deployment-scoped drone point is destroyed before undeploy, but created only in BeforeClass. In the first test method the drone point is destroyed, however before the second test method is launched the test class is enriched including the drone point that is already destroyed.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ARQ-1340) Drone webdriver is not created during @BeforeClass
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQ-1340?page=com.atlassian.jira.plugin.s... ]
Matous Jobanek closed ARQ-1340.
-------------------------------
> Drone webdriver is not created during @BeforeClass
> --------------------------------------------------
>
> Key: ARQ-1340
> URL: https://issues.jboss.org/browse/ARQ-1340
> Project: Arquillian
> Issue Type: Bug
> Components: Extension - Drone
> Affects Versions: drone_1.1.1.Final
> Environment: Arquillian JUnit Container 1.0.3.Final
> Arquillian Graphene Webdriver 2.0.0.Alpha3
> Arquillian Drone dependencies and Selenium dependencies 1.1.1.Final
> Arquillian Core dependencies 1.0.3.Final
> junit 4.8.1
> jdk 1.6
> Reporter: Alex Okrushko
> Assignee: Matous Jobanek
> Fix For: drone_2.0.0.Beta1
>
>
> Drone webdriver is not created during @BeforeClass, however *is created during @Before or if called by GrapheneContext.getProxy()*
> The following does NOT work:
> {code:java}
> @RunWith(Arquillian.class)
> public class TestDroneLogin {
> @Drone
> private static WebDriver driver;
>
> @BeforeClass
> public static void setup(){
> //GrapheneContext.getProxy().navigate().to("http://google.com");
> driver.navigate().to("http://google.com");
> }
>
> @Test
> public void testInput(){
> driver.findElement(By.cssSelector("input#gbqfq"));
> }
> }
> {code}
> However, if I use {{GrapheneContext.getProxy()}} instead of {{driver}}, everything works as expected:
> {code:java}
> @BeforeClass
> public static void setup(){
> GrapheneContext.getProxy().navigate().to("http://google.com");
> }
> {code}
> ALSO, if {{@Before}} is used then Drone webdriver is created as expected, so this problem is specific to {{@BeforeClass}}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months