[arquillian-issues] [JBoss JIRA] (ARQGRA-513) Calling isPresent on root of fragment throws NoSuchElementException

Matous Jobanek (JIRA) issues at jboss.org
Fri Nov 3 10:13:00 EDT 2017


    [ https://issues.jboss.org/browse/ARQGRA-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485657#comment-13485657 ] 

Matous Jobanek commented on ARQGRA-513:
---------------------------------------

Hi, thank you for reporting this issue.
I've been trying to reproduce this issue, but without any success.
This exception is checked in the method `isPresent` so it shouldn't be thrown.
Is your project/test somewhere available (github)

> Calling isPresent on root of fragment throws NoSuchElementException
> -------------------------------------------------------------------
>
>                 Key: ARQGRA-513
>                 URL: https://issues.jboss.org/browse/ARQGRA-513
>             Project: Arquillian Graphene
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.3.1
>            Reporter: S Haster
>
> 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:
> {code:java}
> public abstract class AbstractGKeyHubPage
> {
> 	@FindBy(css = "ul.feedbackPanel")
> 	private GFeedbackPanel feedbackPanel;
> }
> {code}
> The GFeedbackPanel fragment is set up like:
> {code:java}
> public class GFeedbackPanel
> {
> 	@Root
> 	private GrapheneElement panel;
> 	
> 	public void assertNotInfo(String key)
> 	{
> 		boolean present = panel.isPresent();
> 		//... more tests
> 	}
> }
> {code}
> When we call 
> {code:java}
> page.feedbackPanel.assertNotInfo(key);
> {code}
> we get a NoSuchElementException on the feedbackpanel, on the panel.isPresent();-line:
> {noformat}
> 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
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the arquillian-issues mailing list