Skip to content

Driver Sessions #2452

@TheWerewolf

Description

@TheWerewolf

On the page : https://www.selenium.dev/documentation/webdriver/drivers/
the C# sample code opening the web driver is incorrect. It's pointing to this line:

        ChromeOptions options = new ChromeOptions();
        if (browserVersion != null)
        {
            options.BrowserVersion = browserVersion;
            **string userDataDir = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName());**
            System.IO.Directory.CreateDirectory(userDataDir);
            options.AddArgument($"--user-data-dir={userDataDir}");
            options.AddArgument("--no-sandbox");
            options.AddArgument("--disable-dev-shm-usage");
        }
        driver = new ChromeDriver(options);

when it should be pointing to this line:

        ChromeOptions options = new ChromeOptions();
        if (browserVersion != null)
        {
            options.BrowserVersion = browserVersion;
            string userDataDir = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetRandomFileName());
            System.IO.Directory.CreateDirectory(userDataDir);
            options.AddArgument($"--user-data-dir={userDataDir}");
            options.AddArgument("--no-sandbox");
            options.AddArgument("--disable-dev-shm-usage");
        }
        **driver = new ChromeDriver(options);**

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions