Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set Chrome profile #57

Open
Te-zz-trapak opened this issue Jul 11, 2016 · 2 comments
Open

How to set Chrome profile #57

Te-zz-trapak opened this issue Jul 11, 2016 · 2 comments

Comments

@Te-zz-trapak
Copy link

Hello,

is it possible to set chrome profile somehow? ...like for facebook webdriver:

$options = new ChromeOptions();
$options->addArguments(array('user-data-dir=/path/to/chrome_profile'));
$capabilities = DesiredCapabilities::chrome(); 
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
$driver = RemoteWebDriver::create($host, $capabilities, 0, 0);
@Te-zz-trapak
Copy link
Author

I succeeded to start Chrome with my profile:

$driver = new PHPWebDriver_WebDriver();
$arr = array('--user-data-dir=' . dirname(__FILE__) . '/chrome_profile', '--start-maximized');
$session = $driver->session('chrome', array('chromeOptions' => array('args' => list($a, $b) = $arr)));
$session->open("google.com");

If there is some other way please add it here.

PS. this webdriver is perfect, smaller and much easier to use than the facebook webdriver.
Shame it's not so well documented as other webdrivers.

@daluu
Copy link

daluu commented Jul 12, 2016

Shame it's not so well documented as other webdrivers.

That can be unfortunate. But FYI, it appears this project/repo forked from FB original, retains the public wiki the original has. The wiki (of the original) contains pages that pseudo serve as documentation and usage examples - posted by the developer and various contributors (including myself)

Any competent and altruistic user/contributor to this forked driver can add/update the documentation of the wiki of this project. ;-)

I haven't gone through the wiki in detail nor have I used this forked driver, but I'm assuming the wiki is likely out of date, with the info referring to the original FB one, not the fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants