Skip to content

adminb-solutions/selenium-powershell

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selenium PowerShell Module

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

Installation

Install-Module Selenium

OR

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

Usage

Navigate to a URL

$Driver = Start-SeFirefox 
Enter-SeUrl https://www.poshud.com -Driver $Driver

Find an element

$Driver = Start-SeFirefox 
Enter-SeUrl https://www.poshud.com -Driver $Driver
$Element = Find-SeElement -Driver $Driver -Id "myControl"

Click on a button

$Driver = Start-SeFirefox 
Enter-SeUrl https://www.poshud.com -Driver $Driver
$Element = Find-SeElement -Driver $Driver -Id "btnSend"
Invoke-SeClick -Element $Element

Send Keystrokes

$Driver = Start-SeFirefox 
Enter-SeUrl https://www.poshud.com -Driver $Driver
$Element = Find-SeElement -Driver $Driver -Id "txtEmail"
Send-SeKeys -Element $Element -Keys "adam@poshtools.com"

Run Chrome with options

$Driver = Start-SeChrome -Arguments "headless","incognito" 

Wait for an element

$Driver = Start-SeChrome
Enter-SeUrl https://www.google.com -Driver $Driver
Wait-SeElementExists -Driver $Driver -Timeout 3 -Id "q"
Wait-SeElementExists -Driver $Driver -Timeout 3 -Name "q"

About

PowerShell module to run a Selenium WebDriver.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%