Skip to content

Get-SeElement -Filter #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
itfranck opened this issue Dec 5, 2020 · 1 comment
Closed

Get-SeElement -Filter #192

itfranck opened this issue Dec 5, 2020 · 1 comment
Assignees

Comments

@itfranck
Copy link
Collaborator

itfranck commented Dec 5, 2020

This is equivalent to using

Get-SeElement -By TagName -Value Input -Attributes type  | Where {$_.attributes.type -eq 'email'} 
Get-SeElement -By TagName -Value input -Filter {$_.Attributes.type -eq 'email'} -Single -Timeout 4

with the exception that error handling is left to Get-SeElement, meaning that if no element is returned after the filter is applied, an error will be thrown. If the -Single switch is used and multiple elements are found, an error will be thrown.

Any attributes mentionned in the filter will be loaded even if not specified.
For instance, in the following statement, the type attribute will be loaded even though the -Attributes switch was not loaded.

Get-SeElement -By TagName -Value input -Filter {$_.Attributes.type -eq 'email'} -Single -Timeout 4
@itfranck itfranck self-assigned this Dec 5, 2020
@itfranck
Copy link
Collaborator Author

itfranck commented Dec 5, 2020

It is also not implicitely used by Get-SeInput

        $Filter = [scriptblock]::Create(@"
            if ("" -ne "$Type") { if (`$_.Attributes.type -ne "$type") { return } }
            if ("" -ne "$Text") { if (`$_.Text -ne "$Text" ) { return } }
            if ("" -ne "$Value" -and "" -ne "$Attribute") { if (`$_.Attributes."$Attribute" -ne "$Value" ) { return } }
            `$_
"@)
        Get-SeElement -By TagName -Value input @PSBoundParameters @MyAttributes -Filter $Filter

itfranck added a commit that referenced this issue Dec 5, 2020
… )

Also fixed a logic error with $Value that was used both as a parameter and a variable, which caused issues.
@itfranck itfranck closed this as completed Dec 5, 2020
itfranck added a commit that referenced this issue Dec 6, 2020
* Start-SeEdgeDriver throw error on launch (#188)

* Edge fix + general debug fix

* .Where is not a method for CIM Instance object (#190)

* Firefox not using the proper DriverOption (#191)

* Filter parameter to get-seelement and applied to Get-SeInput (#186 #192 )

Also fixed a logic error with $Value that was used both as a parameter and a variable, which caused issues.

* Legacy code removal causing error with screenshots (#187)

* Fix - Filter + Filter error message

* Select input by attributes fix.

* Edge (new) driver option need to be of type ChromeOptions (#195)

* Edge driver option fix (#193)

* Edge - semi revert (#197)

Since Start-SeDriver have priority over options, options should not handle stuff that depends on parameters.

* IE fix (#193)

* MSEdge Fix (#193)

* ErrorAction Stop when MSEdge Service fail to create.

* AcceptInsecureCertificates (Firefox, Chrome, Edge) (#189)

* #177 Get-SeInput view (initial commit)

* V4.0.0-preview2 build

* Drivers update

* V4.0.0-preview2 changelog

* Version update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant