boyka-framework icon indicating copy to clipboard operation
boyka-framework copied to clipboard

⭐ New feature: Capture Screenshot and Element Screenshot using Browsing Context class in Selenium 4

Open mfaisalkhatri opened this issue 1 year ago • 0 comments

📗 Description of the new feature request?

Selenium 4 has introduced Browsing Context class that provides more features such as

  1. Capture a screenshot
  2. Capture viewport Screenshot
  3. Capture Element screenshot https://www.selenium.dev/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context/#capture-screenshot

This class should be utilized in the framework that supports more features

🚧 Scenario where this would be used?

This could prove useful in capturing screenshots.

💁 Supporting information

To use the Browsing Context class we need to set the "webSocketUrl" in the Browser Options class For e.g ChromeOptions options = new ChromeOptions(); options.setCapability("webSocketUrl", true);

mfaisalkhatri avatar Jul 04 '24 18:07 mfaisalkhatri