{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/3203","repository_url":"https://api.github.com/repos/SeleniumHQ/selenium","labels_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/3203/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/3203/comments","events_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/3203/events","html_url":"https://github.com/SeleniumHQ/selenium/issues/3203","id":193477218,"number":3203,"title":"WebElement.FindElement(By.XPath) returns element not relative to parent but to the document","user":{"login":"LirazShay","id":16083652,"avatar_url":"https://avatars.githubusercontent.com/u/16083652?v=3","gravatar_id":"","url":"https://api.github.com/users/LirazShay","html_url":"https://github.com/LirazShay","followers_url":"https://api.github.com/users/LirazShay/followers","following_url":"https://api.github.com/users/LirazShay/following{/other_user}","gists_url":"https://api.github.com/users/LirazShay/gists{/gist_id}","starred_url":"https://api.github.com/users/LirazShay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LirazShay/subscriptions","organizations_url":"https://api.github.com/users/LirazShay/orgs","repos_url":"https://api.github.com/users/LirazShay/repos","events_url":"https://api.github.com/users/LirazShay/events{/privacy}","received_events_url":"https://api.github.com/users/LirazShay/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-12-05T11:51:00Z","updated_at":"2016-12-06T13:35:06Z","closed_at":"2016-12-05T18:20:13Z","body":"## Meta -\r\nOS:  Windows 7\r\nSelenium Version:  3.0.1.0\r\nBrowser:  Chrome\r\n\r\nWhen calling WebElement.FindElement(By.XPath('//element') getting wrong results.\r\nthe result is same as Driver.FindElement(By.XPath('//element') - instead of the element inside that parent.\r\n\r\nI have a workaround:\r\nWebElement.FindElement(By.XPath('.//element') (add '.')\r\nBut I think this is unnecessary because I try to find element inside its parent\r\n\r\n\r\nPage for example:\r\n```html\r\n<html>\r\n<body>\r\n<div id=\"first\">\r\n    <button onclick=\"alert('first Btn clicked');\">firstBtn</button>\r\n</div>\r\n<div id=\"second\">\r\n    <button onclick=\"alert('second Btn clicked');\">secondBtn</button>\r\n</div>\r\n</body>\r\n</html>\r\n```\r\nCode:\r\n```C#\r\n// wrongly clicks first button\r\nDriver.FindElement(By.Id(\"second\")).FindElement(By.XPath(\"//button\")).Click();\r\n// works correct\r\nDriver.FindElement(By.Id(\"second\")).FindElement(By.XPath(\".//button\")).Click();\r\n```"},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/comments/265150752","html_url":"https://github.com/SeleniumHQ/selenium/issues/3203#issuecomment-265150752","issue_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/3203","id":265150752,"user":{"login":"JustinPhlegar","id":8030679,"avatar_url":"https://avatars.githubusercontent.com/u/8030679?v=3","gravatar_id":"","url":"https://api.github.com/users/JustinPhlegar","html_url":"https://github.com/JustinPhlegar","followers_url":"https://api.github.com/users/JustinPhlegar/followers","following_url":"https://api.github.com/users/JustinPhlegar/following{/other_user}","gists_url":"https://api.github.com/users/JustinPhlegar/gists{/gist_id}","starred_url":"https://api.github.com/users/JustinPhlegar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustinPhlegar/subscriptions","organizations_url":"https://api.github.com/users/JustinPhlegar/orgs","repos_url":"https://api.github.com/users/JustinPhlegar/repos","events_url":"https://api.github.com/users/JustinPhlegar/events{/privacy}","received_events_url":"https://api.github.com/users/JustinPhlegar/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T13:35:06Z","updated_at":"2016-12-06T13:35:06Z","body":"If it would help more easily identify that you are searching by direct parent context like in your example, using ( ./ ) is also valid instead of ( .// )."}}
{"actor":{"display_login":"JustinPhlegar"}}