WebView2 support does not work

Originally posted by DanNad on December 02, 2024

Hello everyone. Did someone manage to get this to work?

There is no documentation on webview2 and also smartbear support doesnt seem to know how we can get this to work. We tried a lot of different approaches already but the object spy does not recognize the objects within the webview2 window.

Support gave us the string “–edge-webview-switches=–remote-debugging-port=92223” and we are supposed to add it to the command line field in TestedApps but this doesnt seem to make sense because i dont know how our proprietary software is supposed to know this command line parameter. I tried it anyways but our software is giving us an error message on startup stating the switch is invalid.

I managed to get this to work with our selenium project where we also use the remote debugging port to enable the webdriver to attach to the webview2 process. But i cant figure a way out how this should work with testcomplete.

Originally posted by rraghvani on December 03, 2024

That switch is only applicable to the Chromium browser, i.e. Edge. Are you using the appropriate version that supports WebView2, https://support.smartbear.com/testcomplete/docs/general-info/whats-new.html?sbsearch=webview2

Originally posted by DanNad on December 03, 2024

yes of course i use the latest testcomplete version

Originally posted by rraghvani on December 03, 2024

Just checking. Also, does it meet all the requirements as shown here https://support.smartbear.com/testcomplete/docs/app-testing/web/cef/about.html ?

Originally posted by DanNad on December 04, 2024

I dont see how CEF applies to WebView2. Sure its edge with chromium under the hood but its made by Microsoft and its not the same as CEF

Originally posted by rraghvani on December 04, 2024

You are correct, they are totally two different products. Edge and Chrome both use Chromium as their base, but it doesn’t necessary mean that they use “Chromium Embedded Framework” [face palm emoji]

Originally posted by Marsha_R on December 06, 2024

We have to ask because there is no “of course” with community users. Every user does things differently and many people leave details out of their posts because they are making assumptions as well. :smiley:

Originally posted by DanNad on December 17, 2024

Its the second Testcomplete version (15.70) that states either Web View 2 is supported or there were improvements made to Web View 2 support. Still there is zero article in the Testcomplete documentation pages that tells the user how to get this to work.

Can someone on here tell how to get this to work?

Originally posted by Michael_B on January 23, 2025

No luck with v15.71. Maybe I’m missing a setting. Is there somewhere I need to add the support specifically? I see that it has been supported since v15.69 but don’t see anything about it specifically in on the support site.

Originally posted by DanNad on January 23, 2025

Same for us. 15.71 and its still not working. This is very very disappointing

Originally posted by rraghvani on January 24, 2025

I’ve been looking into this, and learning about WebView2. I have a simple C# WebView2 forms application that displays a web site.

C# WebView2 form application

The Object Browser shows the following

Standard UI controls exposed

Enabling MSAA (TC → Project Settings), exposes the controls of the application

Application controls exposed

Enabling UI Automation (TC → Project Settings), exposes even more of the application

More controls exposed of the application

and also WebView2, including the UI controls within

WebView2 and all UI controls with

For this to work correctly, the appropriate flag settings needs to be enabled for WebView2 control within the application.

Using TC version

If you’re using Selenium WebDriver, then you can use the following command (I haven’t tested this)

var environment = await CoreWebView2Environment.CreateAsync(null, null, new CoreWebView2EnvironmentOptions("--remote-debugging-port=9222"));
await webView.EnsureCoreWebView2Async(environment);

I hope this helps, and gives you a starting point.

Originally posted by DanNad on January 24, 2025

I expect Testcomplete to let me map the objects that are displayed inside of the webview2 windows like other cross browser enabled mappings (e.g. using xpath, css selectors and so on)

This does not work. Enabling UI Automation (TC → Project Settings) doesnt let me do that and this also worked in earlier versions of testcomplete where there was no webview2 support.

Currently our only option is to make a selenium project which uses the remote debugging port and integrate it into the testcomplete testscripts.

Originally posted by rraghvani on January 24, 2025

I had no issues mapping the objects within WebView2. I’ve attached a little video, showing TC interacting with a control using aliases and performing a check-point

Originally posted by DanNad on January 24, 2025

Is it mapped via xpath or css selector ? The video doesnt show this. Can you please show the name mapping?

This is the way we do it in selenium and there is a good reason it should be possible to map it with css/xpath selectors.

Originally posted by rraghvani on January 24, 2025

I was using that standard mapping, not XPath or CSS.

Unfortunately, I’m not able to test this scenario, as my Desktop license is key-based and my Web license is SmartBear ID-based. It’s either one or the other, I don’t have access to both Desktop and Web license.

Originally posted by BD_Geoactive on October 20, 2025

I have an embedded WebView2 components within our desktop application (.NET/Winform) - I’ve found that i couldn’t expose the contents of the component inside/under the WebView2 parent object.

I have ensure the settings as you suggested in the post above are used in my T.C project setting

Originally posted by Hassan_Ballan on October 20, 2025

Sharing some findings that might help others evaluating WebView2 with TestComplete:

:magnifying_glass_tilted_right: Current Observations

  • While TestComplete versions since 15.69 mention WebView2 support, there’s still no official documentation on how to achieve full object recognition inside the control.
  • Based on community reports, DOM-level mapping via XPath/CSS selectors (as in typical web testing) is still not working.
  • UI Automation can expose some UI elements within WebView2, but not actual web content in many setups.

:hammer_and_wrench: Technical Option to Explore

For teams able to modify the application, you might consider enabling remote debugging on the WebView2 control. Example (C#):

var env = await CoreWebView2Environment.CreateAsync(
    null, null, new CoreWebView2EnvironmentOptions("--remote-debugging-port=9222"));
await webView.EnsureCoreWebView2Async(env);

Then attach a Selenium session:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

opts = Options()
opts.add_experimental_option("debuggerAddress", "localhost:9222")
driver = webdriver.Chrome(options=opts)

This can provide DOM access to WebView2 content, similar to how Chrome DevTools works.

:wrench: Notes

  • This approach may not work for all applications — especially if the WebView2 environment can’t be configured to allow remote debugging.
  • It requires coordination with development to set up correctly.
  • A few users in the community have partially validated this, but no complete end-to-end examples are available yet.

Hopefully, this gives others a direction to investigate further while waiting for clearer support from SmartBear.

:robot: AI-assisted response
:+1: Found it helpful? Click Like
:white_check_mark: Issue resolved? Click Mark as Solution

Originally posted by rraghvani on October 21, 2025

It still works in TC v15.77.6.7