{"id":450,"date":"2013-04-02T16:21:24","date_gmt":"2013-04-02T21:21:24","guid":{"rendered":"http:\/\/scottcsims.com\/wordpress\/?p=450"},"modified":"2016-07-12T11:14:02","modified_gmt":"2016-07-12T16:14:02","slug":"how-to-use-a-extension-with-chrome-and-selenium-webdriver","status":"publish","type":"post","link":"http:\/\/scottcsims.com\/wordpress\/?p=450","title":{"rendered":"How to use a extension with chrome and selenium-webdriver"},"content":{"rendered":"<h3>Get the\u00a0extension<\/h3>\n<p>I thought this would be the easy part. Turns out that the new chrome web store only lets you install directly to chrome.<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">Go to the chrome web store and copy the link of the plugin you want \u00a0<\/span><\/li>\n<li><span style=\"line-height: 13px;\">I chose to get adblock\u00a0<a title=\"https:\/\/chrome.google.com\/webstore\/detail\/adblock\/gighmmpiobklfepjocnamgkkbiglidom\" href=\"https:\/\/chrome.google.com\/webstore\/detail\/adblock\/gighmmpiobklfepjocnamgkkbiglidom\">https:\/\/chrome.google.com\/webstore\/detail\/adblock\/gighmmpiobklfepjocnamgkkbiglidom<\/a><\/span><\/li>\n<li>Go to<a title=\"http:\/\/chrome-extension-downloader.com\/\" href=\"http:\/\/chrome-extension-downloader.com\/\">\u00a0http:\/\/chrome-extension-downloader.com\/<\/a>\u00a0and copy the full link from above and click download extension<\/li>\n<\/ul>\n<p><a href=\"http:\/\/scottcsims.com\/wordpress\/wp-content\/uploads\/2013\/04\/downloader.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-452\" src=\"http:\/\/scottcsims.com\/wordpress\/wp-content\/uploads\/2013\/04\/downloader-1024x422.png\" alt=\"downloader\" width=\"573\" height=\"237\" srcset=\"http:\/\/scottcsims.com\/wordpress\/wp-content\/uploads\/2013\/04\/downloader-1024x422.png 1024w, http:\/\/scottcsims.com\/wordpress\/wp-content\/uploads\/2013\/04\/downloader-300x123.png 300w, http:\/\/scottcsims.com\/wordpress\/wp-content\/uploads\/2013\/04\/downloader.png 1802w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/a><\/p>\n<h3>Create And Use a profile<\/h3>\n<ul>\n<li>After you download your crx file put it in the same repo as your test. Next create a chrome profile and use the add_extension method.<\/li>\n<\/ul>\n<pre class=\"brush: ruby\">      profile = Selenium::WebDriver::Chrome::Profile.new\r\n      profile.add_extension(File.dirname(__FILE__) +\"\/chrome_extensions\/adblock\/AdBlock_v2.5.61.crx\")<\/pre>\n<ul>\n<li>Now you can use the new profile to with a driver<\/li>\n<\/ul>\n<pre class=\"brush: ruby\">      Selenium::WebDriver.for(:chrome,:profile =&gt; profile)<\/pre>\n<h3>Trouble Shooting<\/h3>\n<ul>\n<li>be sure that your chromedriver is updated. I used\u00a026.0.1383.0<\/li>\n<li>chrome\u00a0\u00a026.0.1410.43<\/li>\n<li>selenium-webdriver \u00a02.31.0<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Get the\u00a0extension I thought this would be the easy part. Turns out that the new chrome web store only lets you install directly to chrome. Go to the chrome web store and copy the link of the plugin you want \u00a0 I chose to get adblock\u00a0https:\/\/chrome.google.com\/webstore\/detail\/adblock\/gighmmpiobklfepjocnamgkkbiglidom Go to\u00a0http:\/\/chrome-extension-downloader.com\/\u00a0and copy the full link from above and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[33,30],"tags":[],"class_list":["post-450","post","type-post","status-publish","format-standard","hentry","category-chrome","category-selenium-software"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=450"}],"version-history":[{"count":9,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/450\/revisions"}],"predecessor-version":[{"id":465,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/450\/revisions\/465"}],"wp:attachment":[{"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=450"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/scottcsims.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}