Created
March 27, 2014 15:07
-
-
Save cdhunt/9809635 to your computer and use it in GitHub Desktop.
Running automated browser tests with WatiN and PSate.
This file contains hidden or 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
Add-Type -Path C:\WatiN\bin\net40\WatiN.Core.dll | |
if ( [string]::IsNullOrEmpty([psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::get["Find"]) ) | |
{ | |
[psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::add("Find", "WatiN.Core.Find") | |
} | |
Describing 'Bing Search' { | |
Given 'Search for "Automated Ops"' { | |
$ie = New-Object WatiN.Core.IE('http://www.bing.com/') | |
$ie.TextField([Find]::ByName('q')).TypeText('Automated Ops') | |
$ie.Button([Find]::ByName('go')).Click() | |
It 'Contains "Automated Ops"' { | |
$ie.ContainsText('Automated Ops') | Should Be $true | |
} | |
$ie.Close() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment