ChangeWindowSize
This class provides a context manager for temporarily modifying the dimensions of a Selenium browser window. It captures the current window size upon entry, applies the specified width and height, and automatically restores the original dimensions when the context is exited.
Attributes
| Attribute | Type | Description |
|---|---|---|
| selenium | WebDriver | The Selenium WebDriver instance used to manage and resize the browser window. |
| new_size | tuple(int, int) | A tuple containing the target width and height dimensions to be applied to the browser window. |
| old_size | dict | Stores the original browser window dimensions captured upon entering the context to allow for restoration on exit. |
Constructor
Signature
def ChangeWindowSize(
width: int,
height: int,
selenium: object
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| width | int | The target width for the browser window. |
| height | int | The target height for the browser window. |
| selenium | object | The Selenium WebDriver instance to be resized. |