{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1158","repository_url":"https://api.github.com/repos/SeleniumHQ/selenium","labels_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1158/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1158/comments","events_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1158/events","html_url":"https://github.com/SeleniumHQ/selenium/issues/1158","id":111522690,"number":1158,"title":"Chrome + profile. POST session fails with Net::ReadTimeout","user":{"login":"markych","id":15133396,"avatar_url":"https://avatars.githubusercontent.com/u/15133396?v=3","gravatar_id":"","url":"https://api.github.com/users/markych","html_url":"https://github.com/markych","followers_url":"https://api.github.com/users/markych/followers","following_url":"https://api.github.com/users/markych/following{/other_user}","gists_url":"https://api.github.com/users/markych/gists{/gist_id}","starred_url":"https://api.github.com/users/markych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markych/subscriptions","organizations_url":"https://api.github.com/users/markych/orgs","repos_url":"https://api.github.com/users/markych/repos","events_url":"https://api.github.com/users/markych/events{/privacy}","received_events_url":"https://api.github.com/users/markych/received_events","type":"User","site_admin":false},"labels":[{"id":182503883,"url":"https://api.github.com/repos/SeleniumHQ/selenium/labels/C-rb","name":"C-rb","color":"fbca04","default":false},{"id":316341013,"url":"https://api.github.com/repos/SeleniumHQ/selenium/labels/D-chrome","name":"D-chrome","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-10-15T00:47:28Z","updated_at":"2016-12-22T18:07:56Z","closed_at":"2016-12-22T18:07:56Z","body":"Hi all,\ntrying to launch and use Chrome with certain existing profile with selenium on ruby.\n\nCode is very simple:\n\n``` ruby\ndriver = Selenium::WebDriver.for :chrome, :service_log_path => \"d:\\\\chromedriver.log\", :switches => [\n'--profile-directory=Profile 2', '--user-data-dir=C:\\\\Users\\\\myuser\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\User Data', '--log-level=10', '--enable-logging', '--v=10']\ndriver.navigate.to \"http://google.com\"\n```\n\nThis \n- opens a new Chrome window for the 'Profile 2' profile indeed\n- set the focus to address line\n- blocks on the very first line of code above and fails with the following trace after about a minute:\n\n```\nd:/Install/Ruby/ruby/lib/ruby/2.0.0/net/protocol.rb:158:in `rescue in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/protocol.rb:152:in `rbuf_fill'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/protocol.rb:134:in `readuntil'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/protocol.rb:144:in `readline'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http/response.rb:39:in `read_status_line'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http/response.rb:28:in `read_new'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:1406:in `block in transport_request'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:1403:in `catch'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:1403:in `transport_request'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:1376:in `request'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:1369:in `block in request'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:852:in `start'\n    from d:/Install/Ruby/ruby/lib/ruby/2.0.0/net/http.rb:1367:in `request'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/remote/http/default.rb:107:in `response_for'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/remote/http/default.rb:58:in `request'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/remote/http/common.rb:59:in `call'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/remote/bridge.rb:664:in `raw_execute'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/remote/bridge.rb:122:in `create_session'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/remote/bridge.rb:87:in `initialize'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/chrome/bridge.rb:48:in `initialize'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/common/driver.rb:60:in `new'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver/common/driver.rb:60:in `for'\n    from d:/Install/Ruby/ruby/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.48.1/lib/selenium/webdriver.rb:86:in `for'\n    from profile.rb:8:in `<main>'\n-> POST session\n   >>> http://127.0.0.1:9515/session | {\"desiredCapabilities\":{\"browserName\":\"chrome\",\"version\":\"\",\"platform\":\"ANY\",\"javascriptEnabled\":true,\"cssSelectorsEnabled\":true,\"takesScreenshot\":false,\"nativeEvents\":false,\"rotatable\":false,\"chromeOptions\":{\"args\":[\"--profile-directory=Profile 2\",\"--user-data-dir=C:\\\\Users\\\\myuser\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\User Data\",\"--log-level=10\",\"--enable-logging\",\"--v=10\"],\"detach\":true},\"chrome.switches\":[\"--profile-directory=Profile 2\",\"--user-data-dir=C:\\\\Users\\\\myuser\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\User Data\",\"--log-level=10\",\"--enable-logging\",\"--v=10\"],\"chrome.detach\":true}}\n     > {\"Accept\"=>\"application/json\", \"Content-Type\"=>\"application/json; charset=utf-8\", \"Content-Length\"=>\"589\"}\n```\n\nIf I remove \n`\n--profile-directory=Profile 2', '--user-data-dir=C:\\\\Users\\\\myuser\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\User Data'\n`\nfrom 'switches' everything runs smoothly without any exceptions \n- opening new window for temporary profile\n- sets data:, in the address line without focusing into it\n- passes control to the next lines of code\n\nI tried ChromeDriver v.2.19 and 2.20 with the same outcome.\nAny suggestions or guidance would be very appreciated.\n\nRegards,\nMark\n"},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/comments/268856819","html_url":"https://github.com/SeleniumHQ/selenium/issues/1158#issuecomment-268856819","issue_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/1158","id":268856819,"user":{"login":"titusfortner","id":777185,"avatar_url":"https://avatars.githubusercontent.com/u/777185?v=3","gravatar_id":"","url":"https://api.github.com/users/titusfortner","html_url":"https://github.com/titusfortner","followers_url":"https://api.github.com/users/titusfortner/followers","following_url":"https://api.github.com/users/titusfortner/following{/other_user}","gists_url":"https://api.github.com/users/titusfortner/gists{/gist_id}","starred_url":"https://api.github.com/users/titusfortner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titusfortner/subscriptions","organizations_url":"https://api.github.com/users/titusfortner/orgs","repos_url":"https://api.github.com/users/titusfortner/repos","events_url":"https://api.github.com/users/titusfortner/events{/privacy}","received_events_url":"https://api.github.com/users/titusfortner/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T18:07:56Z","updated_at":"2016-12-22T18:07:56Z","body":"With latest Selenium gem and chromedriver, this code successfully starts up Chrome for me with the correct profile and data directory.\r\n\r\n```\r\nswitches = [\"--profile-directory=Profile 2\", \"--log-level=10\", \"--enable-logging\", \"--user-data-dir=/Users/titusfortner/tmp/\"]\r\nSelenium::WebDriver.for :chrome, switches: switches\r\n```\r\n\r\nThis is what is getting sent to the server (found when setting `$DEBUG = true`)\r\n\r\n```\r\n   >>> http://127.0.0.1:9519/session | {\"desiredCapabilities\":{\"browserName\":\"chrome\",\"version\":\"\",\"platform\":\"ANY\",\"javascriptEnabled\":true,\"cssSelectorsEnabled\":true,\"takesScreenshot\":false,\"nativeEvents\":false,\"rotatable\":false,\"chromeOptions\":{\"args\":[\"--profile-directory=Profile 2\",\"--log-level=10\",\"--enable-logging\",\"--user-data-dir=/Users/titusfortner/tmp/\"]}}}\r\n```\r\n"}}
{"actor":{"display_login":"titusfortner"}}