Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 24356

Corey Goldberg: Python - Using Chrome Extensions With Selenium WebDriver

$
0
0
When you launch a Chrome browser from Selenium, a fresh temporary profile is created for the browser session. This means that by default, Chrome extensions are not loaded. To use an extension during a Selenium test, you must install the extension each time you launch a new browser.


Example 1: Installing a packed extension

A packed extension comes in the form of a single .crx file.

You can install a packed extension like this:



Example 2: Installing an unpacked extension

An unpacked extension is a directory containing extension code.

You can install an unpacked extension like this:


examples tested with: chromium 68, chromedriver 2.41, selenium 3.14


Viewing all articles
Browse latest Browse all 24356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>