Chromedriver with PowerShell issue

2,425 views
Skip to first unread message

Jeff Ullmann

unread,
Aug 13, 2014, 12:40:36 PM8/13/14
to chromedri...@googlegroups.com
I'm having trouble getting PowerShell and chromedriver to work together on a Windows 7 system.

OS: Windows 7 x64 Enterprise Service Pack 1 (fully patched)
Chrome: 
ChromeDriver: 2.10.267521
PSVersion: 4.0
WSManStackVersion: 3.0
SerializationVersion: 1.1.0.1
CLRVersion: 4.0.30319.18063
BuildVersion: 6.3.9600.16406
PSCompatibleVersions: {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion: 2.2

The following simple PowerShell script returns the following errors. The first error is when only a single argument argument (ChromeOptions object) is passed in. The second error is when the path to chromedriver, ChromeOptions and a timeout are included in the initialization.

Anybody have thoughts as to what I'm missing or haven't done?


New-Object : Exception calling ".ctor" with "1" argument(s): "Requested value 'Windows NT' was not found."
At C:\Smoketests\Test04.ps1:21 char:12
+ $driver1 = New-Object OpenQA.Selenium.Chrome.ChromeDriver($options)
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
 

New-Object : Exception calling ".ctor" with "3" argument(s): "No response from server for url http://localhost:55995/session"
At C:\Smoketests\Test04.ps1:22 char:12
+ $driver2 = New-Object OpenQA.Selenium.Chrome.ChromeDriver($chromeDriverDir, $opt ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
 


===========================
$webDriverDir = "$PSScriptRoot\tools\WebDriver"
$env:Path += ";C:\Smoketests\tools\WebDriver"
$chromeDriverDir = "C:\Smoketests\tools\WebDriver\"
$chromeExe = 

Add-Type -Path "$webDriverDir\WebDriver.dll"
Add-Type -Path "$webDriverDir\WebDriver.Support.dll"

$capabilities = New-Object OpenQA.Selenium.Remote.DesiredCapabilities
$capabilities.SetCapability("chrome.switches", $capabilityValue)

$options = New-Object OpenQA.Selenium.Chrome.ChromeOptions
$options.AddArgument("--enable-extensions")
$options.addArgument("--start-maximized");
$options.addArgument("--disable-new-ntp");
$options.addArgument("--test-type");
$options.BinaryLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

$driver1 = New-Object OpenQA.Selenium.Chrome.ChromeDriver($options)
$driver2 = New-Object OpenQA.Selenium.Chrome.ChromeDriver($chromeDriverDir, $options, 1000)

Jeff Ullmann

unread,
Aug 13, 2014, 1:25:23 PM8/13/14
to chromedri...@googlegroups.com
I forgot to include the version of Chrome on my system.

Chrome: 36.0.1985.143 m

On Wednesday, August 13, 2014 9:40:36 AM UTC-7, Jeff Ullmann wrote:
> I'm having trouble getting PowerShell and chromedriver to work together on a Windows 7 system.
>
>
> OS: Windows 7 x64 Enterprise Service Pack 1 (fully patched)
> Chrome: 36.0.1985.143 m

Jeff Ullmann

unread,
Aug 13, 2014, 2:14:10 PM8/13/14
to chromedri...@googlegroups.com
Another item I forgot in the configuration was the version of .NET bindings for Selenium.

.Net Bindings: 2.25.1 (selenium-dotnet-2.25.1.zip)

On Wednesday, August 13, 2014 9:40:36 AM UTC-7, Jeff Ullmann wrote:
I'm having trouble getting PowerShell and chromedriver to work together on a Windows 7 system.

OS: Windows 7 x64 Enterprise Service Pack 1 (fully patched)
Chrome: 36.0.1985.143 m
ChromeDriver: 2.10.267521
.Net bindings: 2.25.1 (installed .Net 4)

Jeff Ullmann

unread,
Aug 13, 2014, 2:18:13 PM8/13/14
to chromedri...@googlegroups.com
Found the issue. While looking for the version number for the .Net Bindings, I found that there were newer versions. Once I downloaded and installed what appears to be the most current version 2.31.2 (https://code.google.com/p/selenium/downloads/list?q=label:Featured), everything started working. So I no longer have an issue

JeffU


On Wednesday, August 13, 2014 9:40:36 AM UTC-7, Jeff Ullmann wrote:

fel...@gmail.com

unread,
Aug 15, 2016, 2:42:31 PM8/15/16
to ChromeDriver Users
Hi Jeff,

I know this happened some time ago, but I am running into the same issue, which looks like a setup issue using selenium web driver for Powershell. Do you remember the setup how you changed it to bypass that error? I see chrome opening and crashing afterwards. Thanks!
Reply all
Reply to author
Forward
0 new messages