I'm using selenium 3.14 with geckodriver 0.24, I'm using following code to run the existing profiles I have already created for my different accounts.
FirefoxOptions firefoxOptions = new FirefoxOptions(); firefoxOptions.Proxy = pro; //my proxy object firefoxOptions.AddArgument("-profile " + path); //path to the profile FirefoxDriverService ffDriverService = FirefoxDriverService.CreateDefaultService(); ffDriverService.BrowserCommunicationPort = 2828; PropertiesCollection.Driver = new FirefoxDriver(ffDriverService, firefoxOptions);
I have multiple profiles each with a different proxy. Right now, the browser is started and everything works very well for the first profile, but once I dispose the browser and start a new one with new profile and proxy, the driver opens the same last browser. I've tried many solutions and have changed selenium to old versions but no luck.
One thing I noticed in the console is that when driver opens the browser, it runs a command on console like this:
1561625708285 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile C:\\Users\\Usr\\Desktop\\fprofiles\\pf1" "-foreground" "-no-remote"
if I run this command from cmd the profile issue remains there:
"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile C:\\Users\\Usr\\Desktop\\fprofiles\\pf1" "-foreground" "-no-remote"
If I remove the " from command and make it complete text it will look like this
"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" -marionette -profile C:\\Users\\Usr\\Desktop\\fprofiles\\pf1 -foreground -no-remote
I cloned the selenium project of OpenQA and tried to debug there but that also uses geckodriver.exe and I guess geckodriver.exe is responsible for getting arguments and passing to firefox. Last but the least option will be to compile geckodriver(which has been developed in RUST) once again as per my consent but the programming language is RUST and that's going to be a long long job for achieving what I need. Has anyone faced the same problem? How can I get it fixed?