![]() Using (var fullMs = new MemoryStream((driver.GetScreenshot()). public static Image TakeFullPageScreenshot(this RemoteWebDriver driver, int maxHeight = 10000) It scrolls through the page and composes the full-page screenshot. TestContext.AddTestAttachment(path, "screenshot") Ī("screenshot", "image/png", screenshot) Ĭhanging browser height doesn't always work. Var screenshot = _browser?.TakeScreenshot() Allure or NUnit test results: private void AttachScreenshot() Then you can use the result to attach it to e.g. Extensions let you customize your web-browsing experience by adding functionality with the click of a mouse. Return (Driver as ITakesScreenshot).GetScreenshot().AsByteArray ![]() The image will now automatically download to your computer and. Click on the second option that says Capture full size screenshot. Click the three dot icon and select Run command. Var scrollWidth = (Driver as IJavaScriptExecutor).ExecuteScript(string.Format(getMaxSide, "Width")) ĭriver.Manage().Window.Size = new Size(int.Parse(scrollWidth.ToString()), int.Parse(scrollHeight.ToString())) Launch Chrome and click the menu button and go to More tools > Developer tools. Var scrollHeight = (Driver as IJavaScriptExecutor).ExecuteScript(string.Format(getMaxSide, "Height")) ![]() This one I used in our solution: public byte TakeScreenshot()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |