I have the latest version of Firefox(62.0 32-bit), Selenium(3.14.0.0)and gecko driver(0.22.0 32-bit). I have code as follows:
var firefoxProfile = new FirefoxProfile("XXX");
FirefoxDriverService service =
FirefoxDriverService.CreateDefaultService("XXX", "geckodriver.exe");
service.FirefoxBinaryPath = "XXX";
driver = new FirefoxDriver(service, new FirefoxOptions {
BrowserExecutableLocation = "XXX",
Profile = firefoxProfile,
UseLegacyImplementation = false },
new TimeSpan(0, 1, 30));
However the final line fails due to the following error:
System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\Users\XXX\AppData\Local\Temp\anonymous.5bbc89e65ae54c058b27b9027039414b.webdriver-profile.parentlock'.'
When you look in the directory, the "anonymous.5bbc89e65ae54c058b27b9027039414b.webdriver-profile" folder does not exist.
I can generate a folder by invoking the following code:
firefoxProfile.WriteToDisk();
However I'll still get the same error, just with a different "anonymous" folder after running the final line of my code.
I can get around the issue by enabling "UseLegacyImplementation" but this introduces other issues and is not optimal.
Looking around I don't see this message referenced anywhere, there is something referenced on Github, but it's in reference to the profile being ignored, not erroring.
I've had similar code working on older versions of the library and firefox, for some reason when I try to implement on a different machine with all the latest I experience this issue. Does anyone have any input on this?