File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 33function Start-SeChrome {
44 Param (
55 [Parameter (Mandatory = $false )]
6- [array ]$Arguments
6+ [array ]$Arguments ,
7+ [switch ]$HideVersionHint
78 )
89 if ($Arguments ) {
910 $Chrome_Options = New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeOptions"
1011 $Chrome_Options.AddArguments ($Arguments )
1112 }
13+ if (! $HideVersionHint )
14+ {
15+ Write-Host " Download the right chromedriver from 'http://chromedriver.chromium.org/downloads'" - ForegroundColor Yellow
16+ }
1217 New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeDriver" - ArgumentList $Chrome_Options
1318}
1419
@@ -121,9 +126,18 @@ function Invoke-SeClick {
121126
122127}
123128
129+ function Get-SeKeys {
130+
131+ [OpenQA.Selenium.Keys ] | Get-Member - MemberType Property - Static | Select-Object - Property Name
132+ }
133+
124134function Send-SeKeys {
125135 param ([OpenQA.Selenium.IWebElement ]$Element , [string ]$Keys )
126-
136+
137+ foreach ($Key in @ (Get-SeKeys ).Name)
138+ {
139+ $Keys = $Keys -replace " {{$Key }}" , [OpenQA.Selenium.Keys ]::$Key
140+ }
127141 $Element.SendKeys ($Keys )
128142}
129143
You can’t perform that action at this time.
0 commit comments