Skip to content
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

'acceptInsecureCerts' Argument for Start-SeFirefox? #189

Closed
aescolastico opened this issue Nov 24, 2020 · 4 comments
Closed

'acceptInsecureCerts' Argument for Start-SeFirefox? #189

aescolastico opened this issue Nov 24, 2020 · 4 comments

Comments

@aescolastico
Copy link

Is this an available option?

@itfranck
Copy link
Collaborator

itfranck commented Dec 4, 2020

@aescolastico

As far as I know, it is not possible with V3.
V4 do not support that with a simple switch but is much more flexible when it comes to access stuff under the hood.

In V4, you'd start the browser in the following manner:

Start-SeDriver -Browser Firefox -StartURL 'https://self-signed.badssl.com/'

At that point though, you would get the certificate error.
To go around that and by looking at Selenium Firefox documentation, you can bypass insecure certificate warning by adding a capability to your driver options. V4 do have a function New-SeDriverOptions to expose it.
From there, you can modify the option accordingly and start the browser.

Here is the relevant code.

$Options = New-SeDriverOptions -Browser Firefox
$Options.AddAdditionalCapability([OpenQA.Selenium.Remote.CapabilityType]::AcceptInsecureCertificates, $true,$true)
$Options.ToCapabilities()
Start-SeDriver -Browser Firefox -Options $Options -StartURL 'https://self-signed.badssl.com/'

Note that while testing this, I found an issue (#191) that will prevent this from working in V4.0-preview1.
It is fixed for Preview2 and will work properly (Release is planned within the next 14 days).

V4 is a major rewrite from V3 though and if you had working V3 scripts, there will definitely be rework to make them V4 compliant.

@itfranck itfranck added this to To Do in V4.0 - Preview2 via automation Dec 4, 2020
@itfranck itfranck moved this from To Do to Done in V4.0 - Preview2 Dec 4, 2020
@itfranck
Copy link
Collaborator

itfranck commented Dec 4, 2020

I'll keep this issue open until V4.0.0-Preview2 is released

@itfranck itfranck self-assigned this Dec 5, 2020
@itfranck itfranck moved this from Done to To Do in V4.0 - Preview2 Dec 5, 2020
@itfranck
Copy link
Collaborator

itfranck commented Dec 5, 2020

It looks like at least Chrome support that too.
Therefore, I'll add a switch so you can do :

Start-SeDriver -Browser Firefox -StartURL 'https://self-signed.badssl.com/' -AcceptInsecureCertificates

The New-SeDriverOptions is still useful for anything not implemented directly but in this case, it make sense to add it in the Start-SeDriver switches.

@itfranck itfranck moved this from To Do to Done in V4.0 - Preview2 Dec 6, 2020
@itfranck
Copy link
Collaborator

itfranck commented Dec 6, 2020

Done.

In v4.0-preview2, you'll be able to use :

Start-SeDriver -Browser Edge -StartURL 'https://self-signed.badssl.com/' -AcceptInsecureCertificates

I'll publish a release by Dec. 7th end of day.

@itfranck itfranck closed this as completed Dec 6, 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
No open projects
Development

No branches or pull requests

2 participants