Skip to content

Commit b41f5a0

Browse files
docs: changing window size (#461)
Co-authored-by: Kévin Dunglas <[email protected]> Co-authored-by: Kévin Dunglas <[email protected]>
1 parent fed876e commit b41f5a0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,30 @@ $client = self::createPantherClient([
390390
* `PANTHER_FIREFOX_ARGUMENTS`: to customize Firefox arguments. You need to set `PANTHER_NO_HEADLESS` to `1` value to have full control over arguments.
391391
* `PANTHER_FIREFOX_BINARY`: to use another `firefox` binary
392392

393+
### Changing the Size of the Browser Window
394+
395+
It's possible to control the size of the browser window.
396+
This also controls the size of the screenshots.
397+
398+
399+
Chrome:
400+
401+
```php
402+
$client = Client::createChromeClient(null, ['--window-size=1500,4000']);
403+
```
404+
405+
Or using the `PANTHER_CHROME_ARGUMENTS` environment variable: `PANTHER_CHROME_ARGUMENTS='--window-size=1500,4000'`
406+
407+
Firefox:
408+
409+
```php
410+
use Facebook\WebDriver\WebDriverDimension;
411+
412+
$client = Client::createFirefoxClient();
413+
$size = new WebDriverDimension(1500, 4000);
414+
$client->manage()->window()->setSize($size);
415+
```
416+
393417
### Accessing To Hidden Text
394418

395419
According to the spec, WebDriver implementations return only the **displayed** text by default.

0 commit comments

Comments
 (0)