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 3
3
function Start-SeChrome {
4
4
Param (
5
5
[Parameter (Mandatory = $false )]
6
- [array ]$Arguments
6
+ [array ]$Arguments ,
7
+ [switch ]$HideVersionHint
7
8
)
8
9
if ($Arguments ) {
9
10
$Chrome_Options = New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeOptions"
10
11
$Chrome_Options.AddArguments ($Arguments )
11
12
}
13
+ if (! $HideVersionHint )
14
+ {
15
+ Write-Host " Download the right chromedriver from 'http://chromedriver.chromium.org/downloads'" - ForegroundColor Yellow
16
+ }
12
17
New-Object - TypeName " OpenQA.Selenium.Chrome.ChromeDriver" - ArgumentList $Chrome_Options
13
18
}
14
19
@@ -121,9 +126,18 @@ function Invoke-SeClick {
121
126
122
127
}
123
128
129
+ function Get-SeKeys {
130
+
131
+ [OpenQA.Selenium.Keys ] | Get-Member - MemberType Property - Static | Select-Object - Property Name
132
+ }
133
+
124
134
function Send-SeKeys {
125
135
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
+ }
127
141
$Element.SendKeys ($Keys )
128
142
}
129
143
You can’t perform that action at this time.
0 commit comments