Tutorial by Examples

from selenium import webdriver # Create a new cromedriver driver = webdriver.Chrome() # Go to www.google.com driver.get("https://www.google.com") # Saves a .png file with name my_screenshot_name to the directory that # you are running the program from. screenshot_name = "my_s...
public static Screenshot TakeScreenshot(this IWebDriver _driver) { return ((ITakesScreenshot)_driver).GetScreenshot(); } Usage example: driver.TakeScreenshot().SaveAsFile(@"/Test/Test.png",ImageFormat.Png);
public void Screenshot() throws Throwable{ final byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png"); // ... and embed it in the report. Thread.sleep(1000); } Alternately public static void captureSc...

Page 1 of 1