Locators UI in VSCode not working
When creating new locators in the VSCode extension, the Inspector UI does not open / throws an error referring to
- If your robot uses
pywebviewlibrary directly, you will see the same error.
Many frameworks and libraries that do UI interactions are built on WebView2. WebView2 is essentially built into the new browsers for Windows and macOS.
- On Windows, if you have the new Edge browser installed, WebView2 should be available.
- On Mac, you get this with Safari.
- On Linux,
pywebviewand most implementations leverage the Qt libraries to get a similar capability.
As on Windows, no browsers are forced; it is possible to have a system that does not have WebView2 installed. This is especially common on Windows Server setups, unfortunately.
This problem is pretty much limited to Windows environments, so the solution here is only for Windows.
You need to install one of the two below:
- The WebView2 Evergreen Standalone Installer
- The latest Microsoft Edge browser
Both do the same thing; they set up the Microsoft Edge WebView2 on the system level.