I
I
IvanSstarr2019-02-14 17:47:22
PowerShell
IvanSstarr, 2019-02-14 17:47:22

Powershell+Selenium+Chrome launch with extensions?

When using Powershell+Selenium+Chrome, how to launch a browser with extensions that are already installed?
I found a similar article on python, but I don’t have such methods in powershell.
https://stackoverflow.com/questions/1587137/how-to-select-chrome-e...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azarij, 2019-02-14
@IvanSstarr

this is for one extension. for several, as I understand it, there will be several lines with extensions. and how to get a crx file look in google.
$uri = " yandex.ru "
add-type -path C:\test\selenium\net40\WebDriver.dll
$options = New-Object OpenQA.Selenium.Chrome.ChromeOptions
$options.AddExtension("path_to_crx_file")
$driver = New-Object OpenQA.Selenium.Chrome.ChromeDriver($options)
$driver.url = $uri

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question