Created
December 15, 2016 19:44
-
-
Save bobfrankly/e954f6cc2d25c78216607508502767d1 to your computer and use it in GitHub Desktop.
How to use Selenium with PhantomJS and a custom timeout (instead of 60 seconds)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dllroot = "C:\selenium-dotnet-3.0.0\net35\" | |
Add-Type -Path (join-path $dllroot Selenium.WebDriverBackedSelenium.dll) | |
Add-Type -Path (join-path $dllRoot ThoughtWorks.Selenium.Core.dll) | |
Add-Type -Path (join-path $dllRoot WebDriver.dll) | |
Add-Type -Path (join-path $dllRoot WebDriver.Support.dll) | |
$pjsOptions = New-Object OpenQA.Selenium.PhantomJS.PhantomJSOptions # Needs to have an object of this type | |
$timeout = [timespan]::FromMinutes(12) # Set for 12 minutes | |
$driver = New-Object OpenQA.Selenium.PhantomJS.PhantomJSDriver -ArgumentList ('C:\scripts\ruckusPollSelenium\',$obj,$timeout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment