PowerShell module to run a Selenium WebDriver.
MIT License
Published by itfranck almost 4 years ago
Published by itfranck almost 4 years ago
Selenium-powershell V4 take the concept of previous iterations and pushes it further. A number of significant changes have been made, whic mean you cannot simply upgrade from V3 and expect your tests to work.
Notably, most of the aliases were removed from the module, making the syntax more uniform from now on.
That does mean that picking up a script from another source should not longer be a mystery due to the many aliases (and thus ways) to write the same exact thing.
Some of the functions had duplicates that performed essentially the same thing under a different name (ex: Invoke-SeKeys and Send-SeKeys). Functions that were too similar were removed.
Another big change is the removal of all the Start-SeXX cmdlet in favor of 1 entry point called Start-SeDriver. This will make it easier to ensure the behavior between browser is consistent and that each browser provide the same set of capabilities. Starting a driver will also mark the driver as active, meaning that any command from now on will automatically use that driver to perform the action. The $Driver parameter have been removed altogether and you will now need to use the Switch-SeDriver to switch between active drivers.
Here's a summary of the changes for V4
AsDefaultDriver implementation changed. Instead, Start-SeDriver automatically make the started driver the default. (#93)
Driver parameter was removed on most cmdleet. It is now expected to use the Switch-SeDriver cmdlet to change the active driver if multiple are open.
Start-SeChrome and other have been removed in favor of Start-SeDriver -Browser Chrome (#100)
#98 Removed duplicate functions that performed the same thing or overlapped significantly
Removed all the aliases everywhere on all the parameter / functions in favor of a more rigid way of writing things (#99)
Standardize parameters. Some parameters had different names to mean the same thing (#100)
Revamp Get-SeSelectionOption. The cmdlet have been separated in 3 cmdlet Get/Clear/Set -SeSelectValue. The get cmdlet will also now return the Text & Value of the selected element instead of the text only. (#112)
Set-SeUrl now have a -Depth parameter to navigate forward or back x times (#124)
Get-SeElement now returns visible elements by default. To view hidden elements, the All switch parameter need to be used (#126)
Start-SeDriver -Quiet parameter removal. Quiet is now the default. This remove the extra Selenium verbose and resolves an issue with Driver not being usable in jobs. (#127)
Get-SeElement now write an error if no element are returned. (#135)
cmdlet that expect urls will now accept urls without protocol defined. Assumptions in these cases is that the url is https thus google.ca will be treated as https://www.google.ca (#153)
Get-SeElementAttribute - Accept multiple values and wildcard to load all attributes (#161)
Get-SeElement - support for multiple classname (#160)
Get-SeElementCssValue - support for multiple values / wildcard character (#162)
Sleep / Timeout parameters type changed from int to double (Still seconds, but provide more granularity)
Invoke-SeScreenshot - support for Element screenshot. You can now easily produce a screenshot of a specific element instead of the whole page. (#168)
Added -IgnoreProtectedModeSettings to Start-SeInternetExplorer - https://github.com/adamdriscoll/selenium-powershell/issues/79 - Thanks, @MysticRyuujin!
Added Markdown documentation (See Help subfolder) for all the cmdlets (PlatyPS is used behind the scene to maintain it)
Added MAML embedded help that can be accessed through Get-Help
(eg: Get-Help Start-SeChrome -Examples
)
Added Get-SeUrl / Pop-SeUrl / Push-SeUrl / Set-SeUrl (Thanks @vexx32)
Converted monolythic module into a scaffolded module through a Plaster template. Module will now have a debug version and a compiled version that need to be built with Invoke-Build. See the Debug folder for additional informations on how to debug.
Send-SeKeys won't return an exception if you send $null or empty strings.
Stop-SeDriver won't throw exceptions anymore when called multiple times on a driver already closed.
Published by adamdriscoll about 5 years ago
Published by adamdriscoll about 5 years ago