{"id":1090,"date":"2018-07-13T14:38:50","date_gmt":"2018-07-13T14:38:50","guid":{"rendered":"http:\/\/www.gregkuchyt.net\/?p=1090"},"modified":"2018-07-13T14:38:50","modified_gmt":"2018-07-13T14:38:50","slug":"selenium-grid-with-remote-chromedriver","status":"publish","type":"post","link":"http:\/\/www.gregkuchyt.net\/?p=1090","title":{"rendered":"Selenium Grid with remote ChromeDriver"},"content":{"rendered":"<p>Trying to get Selenium Grid using standalone server 3.13 was kind of a pain. My Chrome remote webdriver calls would error with\u00a0<code>WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist<\/code>.<\/p>\n<p>The solution of adding &#8211;headless and &#8211;no-sandbox to the arguments to ChromeDriver is easily found with a basic Google search but implementing that in Python wasn&#8217;t exactly straight-forward. In my reading of the docs it seemed that adding an array to the capabilities dictionary keyed\u00a0 as &#8216;args&#8217; would pass those arguments on to the subsequent call to chromedriver. Testing showed that that was wrong.<\/p>\n<p>Fortunately, the ChromeOptions object has a method that will convert it into a DesiredCapabilities object that can be passed to the webdriver.Remote instantiation. See below.<\/p>\n<p><code><br \/>\nchrome_options = webdriver.ChromeOptions()<br \/>\nchrome_options.add_argument(\"--headless\")<br \/>\nchrome_options.add_argument(\"--no-sandbox\")<br \/>\nself.browser = webdriver.Remote(command_executor=\"http:\/\/seleniumhub.domain.fqdn:4444\/wd\/hub\", desired_capabilities=chrome_options.to_capabilities())<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trying to get Selenium Grid using standalone server 3.13 was kind of a pain. My Chrome remote webdriver calls would error with\u00a0WebDriverException: Message: unknown error: DevToolsActivePort file doesn&#8217;t exist. The solution of adding &#8211;headless and &#8211;no-sandbox to the arguments to ChromeDriver is easily found with a basic Google search but implementing that in Python wasn&#8217;t [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[9],"tags":[],"class_list":["post-1090","post","type-post","status-publish","format-standard","hentry","category-work"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4mwGD-hA","_links":{"self":[{"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=\/wp\/v2\/posts\/1090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1090"}],"version-history":[{"count":2,"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=\/wp\/v2\/posts\/1090\/revisions"}],"predecessor-version":[{"id":1092,"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=\/wp\/v2\/posts\/1090\/revisions\/1092"}],"wp:attachment":[{"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1090"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gregkuchyt.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}