yuwen790405 / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Allow user to specify template user data dir #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
hat steps will reproduce the problem?
1. Use the following bat file to start ChromeDriver

start java -jar c:\auto\selenium-server-standalone-2.21.0.jar -port 4000 -role 
hub -timeout 240

ping 127.0.0.1 -n 3

for /l %%i in (4011 1 4012) do (
    start java -Dwebdriver.chrome.driver=c:\auto\chromedriver.exe -jar c:\auto\selenium-server-standalone-2.21.0.jar -host 10.254.4.242 -port %%i -role node -nodePolling 300000 -registerCycle 299000 -hub http://10.254.4.242:4000/grid/register -debug -maxSession=1
    ping 127.0.0.1 -n 4
)

2. Use a parral method to access Selenium Grid. 
$desired_capabilities = 
      array('browserName' => "chrome",
            'chrome.switches' => array("--user-data-dir=$chromeProfilePath"),
        ));

One of the ChromeDriver is ok. but the other hang.

When I remove the "chrome.switches" => 
array("--user-data-dir=$chromeProfilePath"), everything is ok.

3.

Simplified test case or site demonstrating the problem:

What version of the product are you using? On what operating system?
ChromeDriver = 19.0.1068.0
Chrome = 18.0.1025.168 m
OS = Windows2003

Please attach chromedriver.log to your bug report if possible.

Original issue reported on code.google.com by groy.zh...@gmail.com on 17 May 2012 at 1:39

Attachments:

GoogleCodeExporter commented 9 years ago
ChromeDriver is freezing because two separate Chrome instances cannot be 
started with the same profile. You need to make a copy of the profile and use 
the copy in the second ChromeDriver instance.

Original comment by kkania@chromium.org on 17 May 2012 at 3:28

GoogleCodeExporter commented 9 years ago
Thanks. And I found the same issue: 
http://code.google.com/p/chromedriver/issues/detail?id=58, but there is no more 
comment in that ticket.

Since Grid is used for ChromeDriver in Server end, it's hard for end 
user(client) to define different profile path, could the second ChromeDriver 
instance be started/configure from Server, e.g. java -jar 
c:\auto\selenium-server-standalone-2.21.0.jar -role node -xx "path/to/profile"?

Thanks again.

Original comment by groy.zh...@gmail.com on 20 May 2012 at 12:22

GoogleCodeExporter commented 9 years ago
What's your use case for starting 2 ChromeDriver servers on the same machine?

Original comment by kkania@chromium.org on 21 May 2012 at 3:53

GoogleCodeExporter commented 9 years ago
Actually, I want to start at least 8 ChromeDriver servers on the same 
machine(the machine is 8 cores, so the performance is not an issue).

I test a website, there are many pages(50+), I need to capture the screenshot 
on test version and online version, and compare the pictures. 

I hope this can be done in least time(in 2min), so I hope it can do this in 
parralel.

There is another similiar situation that is more than 200 testcases need to be 
run in parralel.

Original comment by groy.zh...@gmail.com on 22 May 2012 at 4:02

GoogleCodeExporter commented 9 years ago
Cool. And what's the need for a separate user data directory for each 
ChromeDriver server? By default ChromeDriver will create a temp directory for 
each session.

I think perhaps it would be best to be able to specify a path to a template 
user data dir that ChromeDriver would make a copy of for each session.

Original comment by kkania@chromium.org on 22 May 2012 at 4:44

GoogleCodeExporter commented 9 years ago
“I think perhaps it would be best to be able to specify a path to a template 
user data dir that ChromeDriver would make a copy of for each 
session.”——That would be great!

Is it possible to implement this feature in latest future? Thanks.

Original comment by groy.zh...@gmail.com on 6 Jun 2012 at 7:24

GoogleCodeExporter commented 9 years ago
This is a lower priority item, but one that I am also excited about. As always, 
we always welcome open source patches!

Original comment by kka...@google.com on 6 Jun 2012 at 6:31

GoogleCodeExporter commented 9 years ago
Finally, I hacked the selenium source 
code(http://selenium.googlecode.com/svn/trunk/) to implement it. (It's similar 
to the firefox "-Dwebdriver.firefox.profile=default")

I use -Dwebdriver.chrome.profile.path="path to chrome profile path" to specify 
the --user-data-dir when start ChromeDriver in Selenium Grid.

Is the Selenium ChromeDriver client maintained by Chromium team? Hope Selenium 
ChromeDriver client support this feature in feature.

Original comment by groy.zh...@gmail.com on 10 Jun 2012 at 4:39

GoogleCodeExporter commented 9 years ago
Hello,

I'm also interested in sharing a profile between chromedrivers.
However, I'm interested in sharing the profile during run time, just like 
chrome does for multiple windows. The copy solution implemented for 
firefoxdriver does the trick only for the start settings, not for continuously 
staying in sync.

I was wondering what causes the channel automation error that I see when I 
start two chromedrivers with the same user-profile-dir and whether there is a 
workaround for it other than making a distinct copy of the user-profile-dir 
(which I implemented successfully, but is not enough).

Thanks

Original comment by pavgr...@gmail.com on 3 Jul 2012 at 11:24

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 13 Mar 2013 at 11:56

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 14 Mar 2013 at 9:20

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 14 Mar 2013 at 9:21

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 14 Mar 2013 at 9:59

GoogleCodeExporter commented 9 years ago
I was just looking for this today. Although I create one data directory for 
each Chrome session I have a situation now where the Firefox behavior of 
creating the temporary profile based on a template name/directory worked fine 
to solve the problem. The drawback is that every time we start a session then 
Chromedriver would need to copy the template directory and this takes some 
seconds (just like the Firefoxdriver does). Anyway, a nice feature to have when 
necessary. Perhaps this could be added to Chrome itself like 
"-user-template-data-dir"...

Original comment by mbpp1...@gmail.com on 29 Mar 2013 at 12:36

GoogleCodeExporter commented 9 years ago
I agree this would be a useful feature.

Original comment by kkania@chromium.org on 29 Mar 2013 at 12:40

GoogleCodeExporter commented 9 years ago
Is there any update, as i requires this?

Original comment by manish....@gmail.com on 2 Sep 2013 at 6:57

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 30 Sep 2013 at 10:52

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:19

GoogleCodeExporter commented 9 years ago
Exception "unknown error: failed to write prefs file" is thrown when same 
user-data-dir and profile is used by two chrome instances in parallel.

This is reproducible in chromedriver:2.15

Original comment by ssudunag...@chromium.org on 10 Jun 2015 at 9:55