{"action":"opened","issue":{"url":"https://api.github.com/repos/appium/appium/issues/4615","labels_url":"https://api.github.com/repos/appium/appium/issues/4615/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/4615/comments","events_url":"https://api.github.com/repos/appium/appium/issues/4615/events","html_url":"https://github.com/appium/appium/issues/4615","id":59172819,"number":4615,"title":"Switching context does not work","user":{"login":"hardik-d","id":7215179,"avatar_url":"https://avatars.githubusercontent.com/u/7215179?v=3","gravatar_id":"","url":"https://api.github.com/users/hardik-d","html_url":"https://github.com/hardik-d","followers_url":"https://api.github.com/users/hardik-d/followers","following_url":"https://api.github.com/users/hardik-d/following{/other_user}","gists_url":"https://api.github.com/users/hardik-d/gists{/gist_id}","starred_url":"https://api.github.com/users/hardik-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardik-d/subscriptions","organizations_url":"https://api.github.com/users/hardik-d/orgs","repos_url":"https://api.github.com/users/hardik-d/repos","events_url":"https://api.github.com/users/hardik-d/events{/privacy}","received_events_url":"https://api.github.com/users/hardik-d/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-27T01:05:58Z","updated_at":"2015-02-27T01:05:58Z","closed_at":null,"body":"below is the code snippet:\r\n\r\nset_context \"WEBVIEW_1\"\r\nwithin_context('WEBVIEW_1') do\r\n@driver.find_element(:id, \"button-create-account\").click\r\nend\r\nset_context \"NATIVE_APP\"\r\nwithin_context('NATIVE_APP') do\r\n@driver.find_element(:name, \"icon close\").click\r\nend\r\n//# sleep 2\r\nset_context \"WEBVIEW_1\"\r\nwithin_context('WEBVIEW_1') do\r\n@driver.find_element(:id, \"button-create-account\").click\r\nend\r\n\r\nI am using appium 1.3.4 and above code looks okay to me but i still get Selenium::WebDriver::Error::NoSuchElementError: An element could not be located on the page using the given search parameters.\r\n\r\nI am trying to interact with native and webview elements and thought this simple test should pass. Let me know if need more info.\r\n\r\nAlso notice the commented sleep. if i add sleep the test works.\r\n\r\n"}}