Dear GitHub community,
I have been desperately trying to run selenium-side-runner with a specific Google Chrome profile, using the command line switch user-data-dir
I'm on Windows 7 64 bits.
Unfortunately, after every trial, chrome://version shows that the profile directory is a temporary one (default behaviour of chromedriver).
Here's what I tried :
Note: the "fake-arg" turns out to be necessary, because webdriver (or selenium-side-runner) expects arguments to be an array, not a single string. So I include that fake-arg to overcome that issue.
Any help would be appreciated.
Thank you in advance.
According to this answer on SO, you can also define this profile in the code itself. Wouldn't that be easier to do?
You mean by the command line option profile-directory="Profile 1" ?
I tried that , it didn't work.
I'm not sure what you mean by "the code itself".
You mean I open the .side file and edit it ?
m_Options = new ChromeOptions(); m_Options.AddArgument("--user-data-dir=C:/Users/Me/AppData/Local/Google/Chrome/User Data/Default"); m_Options.AddArgument("--disable-extensions"); m_Driver = new ChromeDriver(@"pathtoexe", m_Options); m_Driver.Navigate().GoToUrl("somesite");
on the SO answer. Could you try to incorporate this into your test cases?
Also what's up with the fake-arg?
However, it did not work.
selenium-side-runner encountered an error :
WebDriverError: unknown error: ChromeOptions is not defined
(look at the bottom of the answer)
Well, I can't really tell what is going wrong there then...
If you don't get enough engagement on your post here, you could consider asking your question, for example, here: https://groups.google.com/forum/#!forum/selenium-users . You could even link this thread here.