You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running Selenium on a "pure IPv6" system where all IPv4 interfaces have been removed, the FindFreePort method, which is used to find a free TCP port to use on the loopback interface for communication to the browser driver, fails since it is hard coded for IPv4 and there are no IPv4 interfaces.
AddressFamily.InterNetwork is IPv4. AddressFamily.InterNetworkV6 is IPv6.
In Pure IPv6 environment, attempt create the Browser Driver object fails with exception: "An address incompatible with the requested protocol was used"
How can we reproduce the issue?
On windows host where selenium is being executed:
-Ensure IPv6 is working as expected
-Remove IPv4 by running: netsh interface ipv4 uninstall
-Reboot for uninstall to complete
-Attempt to use Selenium
The below PowerShell code could be used forexample. Just place the WebDriver.dll and selected browserdriver.exein the same directory as the saved PowerShell script and execute:
Function Get-Browser {
Param (
[Parameter(Mandatory=$true)]
[ValidateSet("Edge","Chrome")]
[string]$type
)
Set-EnvironmentPath
Add-Type -Path "$($PSScriptRoot)\WebDriver.dll"
Switch ($type) {
"edge" {
$Driver = New-Object OpenQA.Selenium.Edge.EdgeDriver
}
"chrome" {
$Driver = New-Object OpenQA.Selenium.Chrome.ChromeDriver
}
}
$Driver
}
Function Set-EnvironmentPath {
# Add the working directory of script to the environment path.# This is required for the WebDriver to work.if(($env:Path -split ';') -notcontains $PSScriptRoot) { Write-Verbose -Message "Enviornment path does not contain $PSScriptRoot. Adding to Path" if ($env:Path.Substring($env:Path.Length-1) -eq ';') {$env:Path += "$PSScriptRoot" } else {$env:Path += ";$PSScriptRoot" } }}$browser= Get-Browser -type Edge
Relevant log output
New-Object : Exception calling ".ctor" with "0" argument(s): "An address incompatible with the requested protocol was used"
At C:\WebDev\Start-Selenium.ps1:14 char:29
+ ... $Driver = New-Object OpenQA.Selenium.Edge.EdgeDriver
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
Operating System
Windows 2019
Selenium version
PowerShell
What are the browser(s) and version(s) where you see this issue?
Edge 131.0.2903.86
What are the browser driver(s) and version(s) where you see this issue?
Microsoft Edge WebDriver 131.0.2903.99 (f96a870b1316f430223b7df17df32918b222060e)
Are you using Selenium Grid?
No
The text was updated successfully, but these errors were encountered:
@SitrucHtims, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template label.
If the issue is a question, add the I-question label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-* label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer label.
What happened?
When running Selenium on a "pure IPv6" system where all IPv4 interfaces have been removed, the FindFreePort method, which is used to find a free TCP port to use on the loopback interface for communication to the browser driver, fails since it is hard coded for IPv4 and there are no IPv4 interfaces.
(https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/Internal/PortUtilities.cs) Line 40
Socket portSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
AddressFamily.InterNetwork is IPv4. AddressFamily.InterNetworkV6 is IPv6.
In Pure IPv6 environment, attempt create the Browser Driver object fails with exception: "An address incompatible with the requested protocol was used"
How can we reproduce the issue?
Relevant log output
Operating System
Windows 2019
Selenium version
PowerShell
What are the browser(s) and version(s) where you see this issue?
Edge 131.0.2903.86
What are the browser driver(s) and version(s) where you see this issue?
Microsoft Edge WebDriver 131.0.2903.99 (f96a870b1316f430223b7df17df32918b222060e)
Are you using Selenium Grid?
No
The text was updated successfully, but these errors were encountered: