Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium Webview2 writing to inaccessible directory #112

Open
jar99 opened this issue Sep 5, 2023 · 1 comment
Open

Selenium Webview2 writing to inaccessible directory #112

jar99 opened this issue Sep 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jar99
Copy link

jar99 commented Sep 5, 2023

When launching selenium webdriver with UseWebView however the application cannot start because WEBVIEW2_USER_DATA_FOLDER is set C:\WINDOWS\SystemTemp\scoped_dir*.

We tried to overwrite this location to a different location by passing in --user-data-dir= or setting our own environment variable.

When its environment variable is overwritten selenium doesn't know the correct location of the user data directory.

what we are using:

  • selenium.webdriver 4.12.4
  • edge 116.0.1938.69
  • edge webdriver 116.0.1938.69
@jar99 jar99 added the bug Something isn't working label Sep 5, 2023
@bwalderman
Copy link
Member

Hi @jar99 . As you found, --user-data-dir won't work to set the user data folder for the WebView2 runtime because Edge WebDriver is passed that arg to your host app, and not to the underlying WebView2 process.

To set the user data folder and other options seen by the WebView2 process, you need to use the webViewOptions object. Details here: https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options#webviewoptions-object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants