BoykaFramework / boyka-framework

🎉 Ultimate test automation framework for automating any application on any platform
https://boykaframework.github.io/boyka-framework/
MIT License
123 stars 42 forks source link

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

Open mfaisalkhatri opened 2 months ago

mfaisalkhatri commented 2 months ago

📗 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);