Skip to content
PowerShell module to run a Selenium WebDriver.
Branch: master
Clone or download
Latest commit 85d3182 Aug 21, 2019

Selenium PowerShell Module

  • Wraps the C# WebDriver for Selenium
  • Easily execute web-based tests
  • Works well with Pester


Install-Module Selenium


Import-Module "{FullPath}\selenium-powershell\Selenium.psm1"


Start a Browser Driver

# Start a driver for a browser of your choise (Chrome/Firefox/Edge/InternetExplorer)
# To start a Firefox Driver
$Driver = Start-SeFirefox 

# To start a Chrome Driver
$Driver = Start-SeChrome

# To start an Edge Driver
$Driver = Start-SeEdge

Navigate to a URL

$Driver = Start-SeFirefox 
Enter-SeUrl -Driver $Driver

Find an element

$Driver = Start-SeFirefox 
Enter-SeUrl -Driver $Driver
$Element = Find-SeElement -Driver $Driver -Id "myControl"

Click on a button

$Driver = Start-SeFirefox 
Enter-SeUrl -Driver $Driver
$Element = Find-SeElement -Driver $Driver -Id "btnSend"
Invoke-SeClick -Element $Element

Send Keystrokes

$Driver = Start-SeFirefox 
Enter-SeUrl -Driver $Driver
$Element = Find-SeElement -Driver $Driver -Id "txtEmail"
Send-SeKeys -Element $Element -Keys ""

Run Chrome with options

# Run Chrome in Headless mode 
$Driver = Start-SeChrome -Headless

# Run Chrome in incognito mode
$Driver = Start-SeChrome -Incognito

# Run Chrome with alternative download folder
$Driver = Start-SeChrome -DefaultDownloadPath  c:\temp

Wait for an element

$Driver = Start-SeChrome
Enter-SeUrl -Driver $Driver
Find-SeElement -Driver $d -Wait -Timeout 10 -Css input[name='q'] 
Find-SeElement -Driver $d -Wait -Timeout 10 -Name q 
You can’t perform that action at this time.