Skip to content

Commit a125e72

Browse files
authored
1 parent 69738cd commit a125e72

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ CI/LocalPostProcessing.ps1
33
Scratchpad.ps1
44
Output/testResults*.xml
55
Output/stats.json
6+
debug.log

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
- Open-SeUrl removed in favor of Set-SeUrl
1515
- Send-SeKeys won't return an exception if you send $null or empty strings.
16+
- Stop-SeDriver won't throw exceptions anymore when celled multiple times on a driver already closed.
1617

1718
# 3.0.0 - 3/31/2020
1819

Output/Selenium/ChangeLog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@
66

77
- Added Markdown documentation (See Help subfolder) for all the cmdlets (PlatyPS is used behind the scene to maintain it)
88
- Added MAML embedded help that can be accessed through `Get-Help`(eg: `Get-Help Start-SeChrome -Examples`)
9+
- Added Get-SeUrl / Pop-SeUrl / Push-SeUrl / Set-SeUrl (Thanks @vexx32)
10+
11+
## Changed
12+
- 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.
13+
14+
- Open-SeUrl removed in favor of Set-SeUrl
15+
- Send-SeKeys won't return an exception if you send $null or empty strings.
16+
- Stop-SeDriver won't throw exceptions anymore when celled multiple times on a driver already closed.
917

1018
# 3.0.0 - 3/31/2020
1119

1220
## Changed
1321

1422
- Fixed issue with importing module in PSv5.1 - https://github.com/adamdriscoll/selenium-powershell/issues/69
1523
- Updated Chrome drivers
16-
- 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.
1724

1825
# 3.0.0-beta2 - 1/29/2020
1926

Output/Selenium/Selenium.psm1

598 Bytes
Binary file not shown.

Public/Stop-SeDriver.ps1

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@ function Stop-SeDriver {
77
[OpenQA.Selenium.IWebDriver]
88
$Target = $Global:SeDriver
99
)
10-
10+
$TextInfo = (Get-Culture).TextInfo
1111
if (($null -ne $Target) -and ($Target -is [OpenQA.Selenium.IWebDriver])) {
12-
Write-Verbose -Message "Closing $($Target.Capabilities.browsername)..."
12+
$BrowserName = $TextInfo.ToTitleCase($Target.Capabilities.browsername)
13+
14+
if ($null -eq $Target.SessionId) {
15+
Write-Warning "$BrowserName Driver already closed"
16+
return $null
17+
}
18+
19+
Write-Verbose -Message "Closing $BrowserName..."
1320
$Target.Close()
14-
$Target.Dispose()
21+
$Target.Dispose()
22+
23+
1524
if ($Target -eq $Global:SeDriver) { Remove-Variable -Name SeDriver -Scope global }
1625
}
17-
else { throw "A valid <IWebDriver> Target must be provided." }
26+
else { Write-Warning 'A valid <IWebDriver> must be provided.' }
1827
}

0 commit comments

Comments
 (0)