
Based on your description, I created simple example and reproduced your problem. I searched the relevant documentation and I think your needs can not be implemented.
In the source code, EdgeOptions in C# has the UseWebView property, and related definitions, as mentioned in the comments. Something like this:
/// <summary>
/// Gets or sets whether to create a WebView session used for launching an Edge (Chromium) WebView-based app on desktop.
/// </summary>
public bool UseWebView
{
get { return this.BrowserName == WebViewBrowserNameValue; }
set { this.BrowserName = value ? WebViewBrowserNameValue : DefaultBrowserNameValue; }
}
But EdgeOptions in Java , there is no relevant definition, I also tried the needs you mentioned using C# and it does work fine, so I think this option is a specific implementation in C#. For more details, you could refer to relevant source code :
EdgeOptions in C#:
https://github.com/SeleniumHQ/selenium/blob/b00c95823c511ba63d601d80232ada078f3af02b/dotnet/src/webdriver/Edge/EdgeOptions.cs
EdgeOptions in Java:
https://github.com/SeleniumHQ/selenium/blob/52845c30e7f514eb6c30a0718a6bacd9c60a0ba0/java/src/org/openqa/selenium/edge/EdgeOptions.java
With all that said, I think there are only two things you can do:
- Switch the WebView2 control to the Edge browser for automation.
- Send your suggestions to the relevant team through the github channel.
Best regards,
Xudong Peng