Accessing Webview in the sidebar #1690
-
I'm a beginner trying to test my VS Code extension using the vscode-extension-tester framework. My extension activates by bringing up a webview in the sidebar, and I'm trying to interact with this webview during testing. I came across #394, but it doesn't seem to work for my specific case. When I attempt to get the title, it fetches the title of the new VS Code landing page in the main editor view instead of the title of my sidebar webview. This is what I've tried: Even though the view seems to open(I'm able to see the view open in debug screenshot), I can’t seem to interact with my sidebar webview as intended. Any tips, suggestions, or examples of how to correctly access and test a sidebar webview using vscode-extension-tester would be incredibly helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Is VS code Welcome Page opened? It is WebView as well and you need to close it to interact with your extension webview. |
Beta Was this translation helpful? Give feedback.
-
Hello, unfortunately there is a bug reported which can bring a WebViews handling flaky in some edge cases. We are working on a fix already. See #1492 |
Beta Was this translation helpful? Give feedback.
Is VS code Welcome Page opened? It is WebView as well and you need to close it to interact with your extension webview.
await new EditorView().closeAllEditors();