Sharing some findings that might help others evaluating WebView2 with TestComplete:
- 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.
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.
- 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.
π€ AI-assisted response
π Found it helpful? Click Like
β
Issue resolved? Click Mark as Solution