Skip to content

Selenium Grid not working with WebView2 application #9714

@pramodkeeliputti12345

Description

@pramodkeeliputti12345

🐛 Bug Report

A clear and concise description of what the bug is.
Selenium Grid not working with WebView2 application.

To Reproduce

Detailed steps to reproduce the behavior:
Run the below c# code

            EdgeOptions edgeOptions = new EdgeOptions();
            edgeOptions.UseChromium = true;
            edgeOptions.UseWebView = true;
            edgeOptions.BinaryLocation = @"C:\MyWebView2App.exe";
            IWebDriver webDriver = new RemoteWebDriver(new Uri("http://127.0.0.1:4444"),edgeOptions);

Below exception occurs:

OpenQA.Selenium.WebDriverException
  HResult=0x80131500
  Message=The HTTP request to the remote WebDriver server for URL http://127.0.0.1:4444/session timed out after 60 seconds.
  Source=WebDriver
  StackTrace:
   at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options)
   at WebViewTesting.Program.Main(String[] args) in 

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
WebException: The operation has timed out.

Expected behavior

A clear and concise description of what you expected to happen.
webDriver is initialized and the application is launched

Test script or set of commands reproducing this issue

The sample test project (WebViewTesting) and sample app (SampleApp) can be found in below git repo.
https://github.com/pramodkeeliputti12345/pramodkeeliputti12345

  1. Start selenium grid 4 (selenium-server-4.0.0-beta-4.jar) in standalone mode.
  2. Load project WebViewTesting in visual studio 2019.
  3. Copy 'SampleApp' folder under c drive.
  4. Run the WebViewTesting application.

Exception occurse @ line number 16. (IWebDriver webDriver = new RemoteWebDriver(new Uri("http://127.0.0.1:4444"),edgeOptions);)

What i am looking is to achieve the below functionality with Selenium Grid.
https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver

This works for EdgeDriver but not working for RemoteWebDriver.

Environment

OS: <Windows 10
Browser: Webview2
Browser version: 91.0.864.37
Browser Driver version: 91.0.864.37
Language Bindings version: C#
Selenium Grid version (if applicable): selenium-server-4.0.0-beta-4.jar

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-gridEverything grid and server related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions