Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 424cf92

Browse files
committed
add cookie management to example.php
This is for pull request php-webdriver/php-webdriver#102
1 parent 209d13d commit 424cf92

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

example.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
// navigate to 'http://docs.seleniumhq.org/'
1212
$driver->get('http://docs.seleniumhq.org/');
1313

14+
// adding cookie
15+
$driver->manage()->deleteAllCookies();
16+
$driver->manage()->addCookie(array(
17+
'name' => 'cookie_name',
18+
'value' => 'cookie_value',
19+
));
20+
$cookies = $driver->manage()->getCookies();
21+
print_r($cookies);
22+
1423
// click the link 'About'
1524
$link = $driver->findElement(
1625
WebDriverBy::id('menu_about')

0 commit comments

Comments
 (0)