Did you know that you can automate the video recording of website tests using the Chrome plugin, HYFY.io?
Here are instructions: https://www.hyfy.io/automate To set up Selenium, you my need to review this post about how to add a browser plugin: https://installselenium.weebly.com/blog/install-a-chrome-plugin-in-selenium. For another code sample in Selenide: https://github.com/jpratt2/CucumberTemplateJava. This demo has a short example for Java and Maven: Sample code for setup: ChromeOptions options = new ChromeOptions() //add this folder as a Chrome extension: chromeExtensions\HYFY\kfhkikpdmehlpkaiplafjkaicdljldcf\3.26.0_0 .addArguments("load-extension=" + System.getProperty("user.dir") + File.separator + "chromeExtensions" + File.separator + "HYFY" + File.separator + "kfhkikpdmehlpkaiplafjkaicdljldcf" + File.separator + "3.26.0_0") .addArguments("--whitelisted-extension-id=kfhkikpdmehlpkaiplafjkaicdljldcf"); WebDriver driver = new ChromeDriver(options);
Code to start recording:
driver.get("chrome-extension://kfhkikpdmehlpkaiplafjkaicdljldcf/index.html#/start-recording"); WebElement firstButton = driver.findElement(By.tagName("button")); firstButton.click();
0 Comments
Leave a Reply. |