We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc39ccf commit 80d1e3dCopy full SHA for 80d1e3d
Selenium.psd1
58 Bytes
Selenium.psm1
@@ -198,3 +198,29 @@ function Save-SeScreenshot {
198
$Screenshot.SaveAsFile($Path, $ImageFormat)
199
}
200
201
+
202
+function Wait-SeElementExists {
203
+ param(
204
+ $Driver,
205
+ $Timeout = 30,
206
+ $Id,
207
+ $Name
208
+ )
209
+ if($Id)
210
+ {
211
+ $TargetElement = [OpenQA.Selenium.By]::Id($Id)
212
+ }
213
+ elseif($Name)
214
215
+ $TargetElement = [OpenQA.Selenium.By]::Name($Name)
216
217
+ else
218
219
+ throw "Please specify -Id or -Name"
220
221
+ $WebDriverWait = New-Object OpenQA.Selenium.Support.UI.WebDriverWait $Driver, ($Timeout * 10000000) # ticks
222
+ $Condition = [OpenQA.Selenium.Support.UI.ExpectedConditions]::ElementExists($TargetElement)
223
+ $WebDriverWait.Until($Condition)
224
+}
225
226
0 commit comments