Why does Selenium always create temporary Firefox profiles using the Web Driver, although I told him to use the existing one?
According to this answer, it is impossible to stop Selenium from creating temporary Firefox profiles using the Web Driver. But with a chronograph, I can achieve this. So why is it different from Firefox. I checked the FirefoxProfile.cs Selenium repo and found that the following snipet code is used to copy the profile ---
public void WriteToDisk() { this.profileDir = GenerateProfileDirectoryName(); if (!string.IsNullOrEmpty(this.sourceProfileDir)) { FileUtilities.CopyDirectory(this.sourceProfileDir, this.profileDir); } else { Directory.CreateDirectory(this.profileDir); } this.InstallExtensions(); this.DeleteLockFiles(); this.DeleteExtensionsCache(); this.UpdateUserPreferences(); }
But for chorme there are no such things.
This is because webdriver installs the extension (webdriver.xpi) to communicate with firefox, while chromedriver.exe is used to interact with chrome.
If so, in version 3.0 webdriver uses geckodriver.exe to communicate with firefox. So, after version 3.0 will webdriver now create a temporary profile for firefox?
Update: Today I played with webdriver v 3.0+ and found that the latest version with legacymode disabled still creates a temporary profile called rust_mozprofile.wUqPXh48avDR . My assumption is that this temporary profile is generated by geckodriver.exe , which is written in Rust
I used chromedriver 3 years ago and am not sure that chromedriver.exe also generates this type of temporary file. Waiting for a response from experts ...
firefox selenium webdriver selenium-chromedriver geckodriver
Rasel Nov 10 '16 at 7:04 2016-11-10 07:04
source share