Skip to content

Commit

Permalink
docs: changing window size (#461)
Browse files Browse the repository at this point in the history
Co-authored-by: Kévin Dunglas <[email protected]>
Co-authored-by: Kévin Dunglas <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent fed876e commit b41f5a0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ $client = self::createPantherClient([
* `PANTHER_FIREFOX_ARGUMENTS`: to customize Firefox arguments. You need to set `PANTHER_NO_HEADLESS` to `1` value to have full control over arguments.
* `PANTHER_FIREFOX_BINARY`: to use another `firefox` binary

### Changing the Size of the Browser Window

It's possible to control the size of the browser window.
This also controls the size of the screenshots.


Chrome:

```php
$client = Client::createChromeClient(null, ['--window-size=1500,4000']);
```

Or using the `PANTHER_CHROME_ARGUMENTS` environment variable: `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 b41f5a0

Please sign in to comment.