{"action":"created","issue":{"url":"https://api.github.com/repos/maxwu/selenide-toy/issues/1","repository_url":"https://api.github.com/repos/maxwu/selenide-toy","labels_url":"https://api.github.com/repos/maxwu/selenide-toy/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/maxwu/selenide-toy/issues/1/comments","events_url":"https://api.github.com/repos/maxwu/selenide-toy/issues/1/events","html_url":"https://github.com/maxwu/selenide-toy/issues/1","id":214629656,"number":1,"title":"Cannot capture exception when accessing element properties with selenide","user":{"login":"maxwu","id":572243,"avatar_url":"https://avatars3.githubusercontent.com/u/572243?v=3","gravatar_id":"","url":"https://api.github.com/users/maxwu","html_url":"https://github.com/maxwu","followers_url":"https://api.github.com/users/maxwu/followers","following_url":"https://api.github.com/users/maxwu/following{/other_user}","gists_url":"https://api.github.com/users/maxwu/gists{/gist_id}","starred_url":"https://api.github.com/users/maxwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxwu/subscriptions","organizations_url":"https://api.github.com/users/maxwu/orgs","repos_url":"https://api.github.com/users/maxwu/repos","events_url":"https://api.github.com/users/maxwu/events{/privacy}","received_events_url":"https://api.github.com/users/maxwu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-16T08:28:59Z","updated_at":"2017-03-16T14:16:55Z","closed_at":null,"body":"With SelenideElement proxy, when accessing the properties, the WebElement was searched with driver but it threw exception instead of returning null.\r\n\r\n```java\r\n// Get Element within Page Object\r\nreturn $(\"#rso div._uX div._XWk\");\r\n```\r\n\r\n```java\r\n// Extract data with Page Object\r\npublic List<String> getGenres(){\r\n        List<String> genres;\r\n        try{\r\n            genres = Arrays.asList(getGenreDiv().getText().split(\"/\"));\r\n        }catch (Exception e){\r\n            genres = new ArrayList<>(Arrays.asList(\"NA\"));\r\n        }\r\n        logger.debug(\"Genres are: \" + genres.stream().collect(Collectors.joining()));\r\n        return genres;\r\n    }\r\n```\r\n\r\nIn either place, the exception cannot be directly captured. Record the reproducing cmd as usual `me.maxwu.selenide.BillboardTop100GenreTest`. \r\n\r\n```\r\ntestTop10Genres(me.maxwu.selenide.BillboardTop100GenreTest)  Time elapsed: 39.793 sec  <<< FAILURE!\r\nElement not found {#rso div._uX div._XWk}\r\nExpected: exist\r\nScreenshot: file:/Users/maxwu/devel/selenide-toy/target/1489635016323.0.png\r\nTimeout: 4 s.\r\nCaused by: NoSuchElementException: no such element: Unable to locate element: {\"method\":\"css selector\",\"selector\":\"#rso div._uX div._XWk\"}\r\n\tat \r\n\t//... ... \r\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)\r\nCaused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {\"method\":\"css selector\",\"selector\":\"#rso div._uX div._XWk\"}\r\n  (Session info: chrome=58.0.3029.19)\r\n  (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)\r\nCommand duration or timeout: 9 milliseconds\r\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html\r\nBuild info: version: '3.1.0', revision: 'b94c902', time: '2017-02-16 12:21:31 -0800'\r\nSystem info: host: 'MaxWudeMacBook-Pro.local', ip: 'fe80:0:0:0:aebc:32ff:fe9a:5a9d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_102'\r\nDriver info: org.openqa.selenium.chrome.ChromeDriver\r\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=/var/folders/gq/kylyhbzd2wxgp8j_dm031t8h0000gn/T/.org.chromium.Chromium.Ns9Vla}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=58.0.3029.19, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]\r\nSession ID: 6b4fb12f6d032af2908e5148700531cd\r\n*** Element info: {Using=css selector, value=#rso div._uX div._XWk}\r\n\tat sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\r\n\tat org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)\r\n\tat org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:465)\r\n\tat org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)\r\n\tat org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)\r\n\tat com.codeborne.selenide.impl.WebElementSelector.findElement(WebElementSelector.java:28)\r\n\tat com.codeborne.selenide.impl.ElementFinder.getWebElement(ElementFinder.java:56)\r\n\tat com.codeborne.selenide.commands.GetText.execute(GetText.java:13)\r\n\tat com.codeborne.selenide.commands.GetText.execute(GetText.java:8)\r\n\tat com.codeborne.selenide.commands.Commands.execute(Commands.java:140)\r\n\tat com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:86)\r\n\t... 36 more\r\n```"},"comment":{"url":"https://api.github.com/repos/maxwu/selenide-toy/issues/comments/287070704","html_url":"https://github.com/maxwu/selenide-toy/issues/1#issuecomment-287070704","issue_url":"https://api.github.com/repos/maxwu/selenide-toy/issues/1","id":287070704,"user":{"login":"maxwu","id":572243,"avatar_url":"https://avatars3.githubusercontent.com/u/572243?v=3","gravatar_id":"","url":"https://api.github.com/users/maxwu","html_url":"https://github.com/maxwu","followers_url":"https://api.github.com/users/maxwu/followers","following_url":"https://api.github.com/users/maxwu/following{/other_user}","gists_url":"https://api.github.com/users/maxwu/gists{/gist_id}","starred_url":"https://api.github.com/users/maxwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxwu/subscriptions","organizations_url":"https://api.github.com/users/maxwu/orgs","repos_url":"https://api.github.com/users/maxwu/repos","events_url":"https://api.github.com/users/maxwu/events{/privacy}","received_events_url":"https://api.github.com/users/maxwu/received_events","type":"User","site_admin":false},"created_at":"2017-03-16T14:16:55Z","updated_at":"2017-03-16T14:16:55Z","body":"It is resolved, just reopen to keep an eye on summary writing.\r\nOutput is still a step of learning to complete."}}
{"actor":{"display_login":"maxwu"}}