{"action":"created","issue":{"url":"https://api.github.com/repos/codeborne/selenide/issues/218","labels_url":"https://api.github.com/repos/codeborne/selenide/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/codeborne/selenide/issues/218/comments","events_url":"https://api.github.com/repos/codeborne/selenide/issues/218/events","html_url":"https://github.com/codeborne/selenide/issues/218","id":105191409,"number":218,"title":"NoSuchElementException thrown, but ElementNotFound must be catched","user":{"login":"crocodilechris","id":6795240,"avatar_url":"https://avatars.githubusercontent.com/u/6795240?v=3","gravatar_id":"","url":"https://api.github.com/users/crocodilechris","html_url":"https://github.com/crocodilechris","followers_url":"https://api.github.com/users/crocodilechris/followers","following_url":"https://api.github.com/users/crocodilechris/following{/other_user}","gists_url":"https://api.github.com/users/crocodilechris/gists{/gist_id}","starred_url":"https://api.github.com/users/crocodilechris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crocodilechris/subscriptions","organizations_url":"https://api.github.com/users/crocodilechris/orgs","repos_url":"https://api.github.com/users/crocodilechris/repos","events_url":"https://api.github.com/users/crocodilechris/events{/privacy}","received_events_url":"https://api.github.com/users/crocodilechris/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/codeborne/selenide/labels/cannot%20preproduce","name":"cannot preproduce","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-09-07T10:28:56Z","updated_at":"2015-11-03T22:09:15Z","closed_at":null,"body":"**The Problem**:\r\nIf it is tried to select a not listed option, then I want to handle the occuring error. \r\nThe stack trace says the problem is \"Caused by: NoSuchElementException\". I know, that I have to catch the \"org.openqa.selenium.NoSuchElementException\", but both are not catched, nor even \"Exception\" is catched.\r\nI see that selenide calls `throwElementNotFound()`.\r\n\r\n**The Workaround**:\r\nI have to catch \"ElementNotFound\" to handle this.\r\n\r\n**The Code**:\r\n```java\r\nSelenideElement select = $(By.name(\"domainsetId\"));\r\n\t\ttry {\r\n\t\t\tselect.selectOption(\"ERROR\");\r\n\t\t} catch (org.openqa.selenium.NoSuchElementException | NoSuchElementException ex) {\r\n\t\t\tSystem.out.println(\"Not found\");\r\n\t\t\treturn false;\r\n\t\t}\r\n```\r\n**The failure trace**:\r\n```\r\nElement not found {by text: ERROR}\r\nExpected: visible\r\nScreenshot: file:/home/XXX/git/selenium/Screenshots/1441620116678.0.png\r\nTimeout: 4 s.\r\nCaused by: NoSuchElementException: no such element\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.throwElementNotFound(AbstractSelenideElement.java:601)\r\n\tat com.codeborne.selenide.impl.WaitingSelenideElement.throwElementNotFound(WaitingSelenideElement.java:75)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.waitUntil(AbstractSelenideElement.java:593)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.should(AbstractSelenideElement.java:411)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.should(AbstractSelenideElement.java:406)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.invokeShould(AbstractSelenideElement.java:243)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.dispatch(AbstractSelenideElement.java:120)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.invoke(AbstractSelenideElement.java:55)\r\n\tat com.codeborne.selenide.impl.WaitingSelenideElement.invoke(WaitingSelenideElement.java:19)\r\n\tat com.sun.proxy.$Proxy4.shouldBe(Unknown Source)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.selectOptionByText(AbstractSelenideElement.java:488)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.dispatch(AbstractSelenideElement.java:169)\r\n\tat com.codeborne.selenide.impl.AbstractSelenideElement.invoke(AbstractSelenideElement.java:55)\r\n\tat com.codeborne.selenide.impl.WaitingSelenideElement.invoke(WaitingSelenideElement.java:19)\r\n\tat com.sun.proxy.$Proxy4.selectOption(Unknown Source)\r\n\tat com.COMPANY.qm.smgw.MessengerManager.selectMandator(MessengerManager.java:129)\r\n\tat com.COMPANY.qm.smgw.msg.MessengerManagerTest.test_selectMandator(MessengerManagerTest.java:81)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)\r\n\tat org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:309)\r\n\tat org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)\r\n\tat org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)\r\n```"},"comment":{"url":"https://api.github.com/repos/codeborne/selenide/issues/comments/153505023","html_url":"https://github.com/codeborne/selenide/issues/218#issuecomment-153505023","issue_url":"https://api.github.com/repos/codeborne/selenide/issues/218","id":153505023,"user":{"login":"asolntsev","id":279773,"avatar_url":"https://avatars.githubusercontent.com/u/279773?v=3","gravatar_id":"","url":"https://api.github.com/users/asolntsev","html_url":"https://github.com/asolntsev","followers_url":"https://api.github.com/users/asolntsev/followers","following_url":"https://api.github.com/users/asolntsev/following{/other_user}","gists_url":"https://api.github.com/users/asolntsev/gists{/gist_id}","starred_url":"https://api.github.com/users/asolntsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asolntsev/subscriptions","organizations_url":"https://api.github.com/users/asolntsev/orgs","repos_url":"https://api.github.com/users/asolntsev/repos","events_url":"https://api.github.com/users/asolntsev/events{/privacy}","received_events_url":"https://api.github.com/users/asolntsev/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T22:09:15Z","updated_at":"2015-11-03T22:09:15Z","body":"I guess the issue can be closed?"}}