Skip to content

Commit

Permalink
Adding window-size
Browse files Browse the repository at this point in the history
I haven't tested Chrome; it's taken from symfony#428 (which can be closed now IMO)
Firefox works for me; it's taken from https://stackoverflow.com/a/64374604/1668200
  • Loading branch information
ThomasLandauer committed Apr 16, 2021
1 parent ec2ff07 commit 244f597
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,27 @@ $client = self::createPantherClient([
* `PANTHER_FIREFOX_ARGUMENTS`: to customize Firefox arguments. You need to set `PANTHER_NO_HEADLESS` to fully customize.
* `PANTHER_FIREFOX_BINARY`: to use another `firefox` binary

### Changing the Size of the Brwoser Window

This also controls the size of the screenshots.

Chrome:

```php
$client = Client::createChromeClient(null, ['--window-size=1500,4000']);
```
or set it via `.env`:
```
PANTHER_CHROME_ARGUMENTS='--window-size=1500,4000'
```
Firefox:
```php
use Facebook\WebDriver\WebDriverDimension;
$client = Client::createFirefoxClient();
$size = new WebDriverDimension(1500, 4000);
$client->manage()->window()->setSize($size);
```

### Accessing To Hidden Text

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

0 comments on commit 244f597

Please sign in to comment.