Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8340687

Browse files
committed
#176 hotfix - driver parameter removal
1 parent 67b49b1 commit 8340687

30 files changed

+39
-81
lines changed

‎Help/Get-SeUrl.md‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Retrieves the current URL of a target webdriver instance.
1313
## SYNTAX
1414

1515
```
16-
Get-SeUrl [-Stack] [[-Driver] <Object>] [<CommonParameters>]
16+
Get-SeUrl [-Stack] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -47,21 +47,6 @@ Accept pipeline input: False
4747
Accept wildcard characters: False
4848
```
4949
50-
### -Driver
51-
The webdriver instance for which to retrieve the current URL or internal URL stack.
52-
53-
```yaml
54-
Type: Object
55-
Parameter Sets: (All)
56-
Aliases:
57-
58-
Required: False
59-
Position: 1
60-
Default value: None
61-
Accept pipeline input: True (ByValue)
62-
Accept wildcard characters: False
63-
```
64-
6550
### CommonParameters
6651
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
6752

‎Internal/Init-SeDriver.ps1‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
function Init-SeDriver {
22
[CmdletBinding()]
3-
param (
4-
[ref]$Driver,
5-
[OpenQA.Selenium.IWebElement[]]$Element
6-
)
3+
param ($Element)
74

8-
if ($null -ne $Driver.Value) { return }
9-
if ($null -ne $Element) { $Driver.Value = ($Element | Select -First 1).WrappedDriver }
10-
if ($null -ne $script:SeDriversCurrent) { $Driver.Value = $script:SeDriversCurrent; return }
11-
Throw [System.ArgumentNullException]::new("A driver need to be explicitely specified or implicitely available.")
5+
IF ($null -NE $Element) {
6+
$Driver = ($Element | Select-Object -First 1).WrappedDriver
7+
}
8+
$Driver = Get-SeDriver -Current -ErrorAction Stop
9+
10+
if ($null -eq $Driver) {
11+
Throw [System.ArgumentNullException]::new("An available Driver could not be found.")
12+
}
13+
14+
1215

1316

1417

‎Output/Selenium/Selenium.psm1‎

-1.27 KB
Binary file not shown.

‎Output/Selenium/en-US/Selenium-help.xml‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,18 +1382,6 @@ PS C:\&gt; $Element | Get-SeHtml -Inner</dev:code>
13821382
<command:syntax>
13831383
<command:syntaxItem>
13841384
<maml:name>Get-SeUrl</maml:name>
1385-
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="1" aliases="none">
1386-
<maml:name>Driver</maml:name>
1387-
<maml:Description>
1388-
<maml:para>The webdriver instance for which to retrieve the current URL or internal URL stack.</maml:para>
1389-
</maml:Description>
1390-
<command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
1391-
<dev:type>
1392-
<maml:name>Object</maml:name>
1393-
<maml:uri />
1394-
</dev:type>
1395-
<dev:defaultValue>None</dev:defaultValue>
1396-
</command:parameter>
13971385
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
13981386
<maml:name>Stack</maml:name>
13991387
<maml:Description>
@@ -1420,18 +1408,6 @@ PS C:\&gt; $Element | Get-SeHtml -Inner</dev:code>
14201408
</dev:type>
14211409
<dev:defaultValue>False</dev:defaultValue>
14221410
</command:parameter>
1423-
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="1" aliases="none">
1424-
<maml:name>Driver</maml:name>
1425-
<maml:Description>
1426-
<maml:para>The webdriver instance for which to retrieve the current URL or internal URL stack.</maml:para>
1427-
</maml:Description>
1428-
<command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
1429-
<dev:type>
1430-
<maml:name>Object</maml:name>
1431-
<maml:uri />
1432-
</dev:type>
1433-
<dev:defaultValue>None</dev:defaultValue>
1434-
</command:parameter>
14351411
</command:parameters>
14361412
<command:inputTypes />
14371413
<command:returnValues />

‎Public/Clear-SeAlert.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function Clear-SeAlert {
88
[switch]$PassThru
99
)
1010
Begin {
11-
Init-SeDriver-Driver ([ref]$Driver) -ErrorAction Stop
11+
$Driver=Init-SeDriver -ErrorAction Stop
1212
$ImpTimeout = 0
1313
}
1414
Process {

‎Public/Get-SeCookie.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function Get-SeCookie {
22
[CmdletBinding()]
33
param()
4-
Init-SeDriver-Driver ([ref]$Driver) -ErrorAction Stop
4+
$Driver=Init-SeDriver -ErrorAction Stop
55
$Driver.Manage().Cookies.AllCookies.GetEnumerator()
66
}

‎Public/Get-SeDriverTimeout.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Get-SeDriverTimeout {
66
$TimeoutType = 'ImplicitWait'
77
)
88
begin {
9-
Init-SeDriver-Driver ([ref]$Driver) -ErrorAction Stop
9+
$Driver=Init-SeDriver -ErrorAction Stop
1010
}
1111
Process {
1212
return $Driver.Manage().Timeouts().$TimeoutType

‎Public/Get-SeElement.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function Get-SeElement {
2020
[Switch]$Single
2121
)
2222
Begin {
23-
Init-SeDriver-Driver ([ref]$Driver) -ErrorAction Stop
23+
$Driver=Init-SeDriver -ErrorAction Stop
2424
$ShowAll = $PSBoundParameters.ContainsKey('All') -and $PSBoundParameters.Item('All') -eq $true
2525
if ($By.Count -ne $Value.Count) {
2626
Throw [System.InvalidOperationException]::new("An equal number of `$By element ($($By.Count)) and `$Value ($($Value.Count)) must be provided.")

‎Public/Get-SeFrame.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function Get-SeFrame {
22
[cmdletbinding()]
33
param()
44

5-
Init-SeDriver-Driver ([ref]$Driver) -ErrorAction Stop
5+
$Driver=Init-SeDriver -ErrorAction Stop
66

77
Get-SeElement -By TagName -Value iframe -Attributes name, id -ErrorAction SilentlyContinue |
88
ForEach-Object {

‎Public/Get-SeHtml.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Get-SeHtml {
66
[switch]$Inner
77
)
88
Begin {
9-
Init-SeDriver-Driver ([ref]$Driver) -ErrorAction Stop
9+
$Driver=Init-SeDriver -ErrorAction Stop
1010
}
1111
Process {
1212
if ($PSBoundParameters.ContainsKey('Element')) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /