FirefoxDriverService ds = FirefoxDriverService.CreateDefaultService(); ds.HideCommandPromptWindow = true; FirefoxOptions opt = new FirefoxOptions(); opt.Profile = new FirefoxProfile(@"C:\111\"); IWebDriver Wd = new FirefoxDriver(ds, opt); 

I tried it this way, but after starting the instance, the "C: \ 111 \" continues to be empty. I want cookies, caches, extensions to be stored in this folder ...

FirefoxOptions.Profile.ProfileDirectory - this one is read-only, it turns out, how to install it is not clear.

    1 answer 1

    1. First create a profile
    2. And then we use it as in the example code in the question itself.

    To create a profile, run the fayarfoks with the -P prefix (this should be done when all browser instances are closed)

     firefox.exe -P