Uploaded image for project: 'Arquillian Graphene'
  1. Arquillian Graphene
  2. ARQGRA-513

Calling isPresent on root of fragment throws NoSuchElementException

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      We have a page object that includes a fragment. The fragment injects its root as a GrapheneElement so we could call isPresent() on it. However, if we do actually call isPresent() it throws a NoSuchElementException for the fragment.

      The page is as follows:

      public abstract class AbstractGKeyHubPage
      {
      	@FindBy(css = "ul.feedbackPanel")
      	private GFeedbackPanel feedbackPanel;
      }
      

      The GFeedbackPanel fragment is set up like:

      public class GFeedbackPanel
      {
      	@Root
      	private GrapheneElement panel;
      	
      	public void assertNotInfo(String key)
      	{
      		boolean present = panel.isPresent();
      		//... more tests
      	}
      }
      

      When we call

      page.feedbackPanel.assertNotInfo(key);
      

      we get a NoSuchElementException on the feedbackpanel, on the panel.isPresent();-line:

      Caused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"ul.feedbackPanel"}
        (Session info: headless chrome=61.0.3163.100)
        (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.13.0-16-lowlatency x86_64) (WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 0 milliseconds
      For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
      Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
      System info: host: 'schootbak3', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-16-lowlatency', java.version: '1.8.0_144'
      Driver info: org.openqa.selenium.remote.RemoteWebDriver
      Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=LINUX, acceptSslCerts=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=LINUX, setWindowRect=true, unexpectedAlertBehaviour=, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4), userDataDir=/tmp/.org.chromium.Chromium.uoWwlR}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, version=61.0.3163.100, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
      Session ID: 7f36f43306ea95223042b19584846cfe
      *** Element info: {Using=css selector, value=ul.feedbackPanel}
      	at org.jboss.arquillian.graphene.enricher.WebElementUtils$5.getTarget(WebElementUtils.java:135)
      	at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.getTarget(GrapheneProxyHandler.java:149)
      	at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$1.getTarget(GrapheneContextualHandler.java:218)
      	at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler$1.invoke(GrapheneContextualHandler.java:169)
      	at org.jboss.arquillian.graphene.enricher.StaleElementInterceptor$1.apply(StaleElementInterceptor.java:47)
      	at org.jboss.arquillian.graphene.enricher.StaleElementInterceptor$1.apply(StaleElementInterceptor.java:43)
      	at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:209)
      	at org.jboss.arquillian.graphene.wait.WebDriverWaitImpl.until(WebDriverWaitImpl.java:96)
      	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.intercept.InterceptorBuilder$2.intercept(InterceptorBuilder.java:139)
      	at org.jboss.arquillian.graphene.proxy.InvocationContextImpl.invoke(InvocationContextImpl.java:87)
      	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.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 nl.topicus.keyhub.arquillian.selenium.fragment.panel.GFeedbackPanel.assertNotInfo(GFeedbackPanel.java:78)
      	at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.invokeReal(GrapheneProxyHandler.java:130)
      	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)
      	... 1 more
      Caused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"ul.feedbackPanel"}
        (Session info: headless chrome=61.0.3163.100)
        (Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.13.0-16-lowlatency x86_64) (WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 0 milliseconds
      For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
      Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
      System info: host: 'schootbak3', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-16-lowlatency', java.version: '1.8.0_144'
      Driver info: org.openqa.selenium.remote.RemoteWebDriver
      Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=LINUX, acceptSslCerts=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=LINUX, setWindowRect=true, unexpectedAlertBehaviour=, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4), userDataDir=/tmp/.org.chromium.Chromium.uoWwlR}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, version=61.0.3163.100, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
      Session ID: 7f36f43306ea95223042b19584846cfe
      *** Element info: {Using=css selector, value=ul.feedbackPanel}
      	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
      	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
      	at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
      	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
      	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
      	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
      	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
      	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:416)
      	at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:510)
      	at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
      	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:408)
      	at org.openqa.selenium.remote.Augmenter$CompoundHandler.intercept(Augmenter.java:189)
      	at org.jboss.arquillian.graphene.enricher.WebElementUtils.dropProxyAndFindElement(WebElementUtils.java:168)
      	at org.jboss.arquillian.graphene.enricher.WebElementUtils$5.getTarget(WebElementUtils.java:133)
      	... 24 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                buurmansven S Haster
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: