Capture screenshot in Selenium C# WebDriver

Поділитися
Вставка
  • Опубліковано 1 гру 2024

КОМЕНТАРІ • 5

  • @kamujusoundarya6584
    @kamujusoundarya6584 5 років тому

    i am getting unauthorised acess exception to the path given how to solve this.plz reply

  • @AnirudhGarg1123
    @AnirudhGarg1123 7 років тому

    @Tutor,
    Thanks for putting up short and to the point videos.
    I have question regarding capturing screenshot. What should I do in case I have to take the screenshot of whole page as one image. Currently it takes only the portion which is displayed. Our webpage is quite long and we have scroll down to access it.

    • @Tutor4ever
      @Tutor4ever  7 років тому

      Hi Anirudh,
      Thank you very much for your feedback.
      As of now capturing the screenshot of the entire webpage is not yet implemented.
      As a work around you could scroll down your webpage to a particular web element and then take the screenshot.
      The code snippet for the same is:
      Using openqa.selenium.interactions;
      Iwebelement element =driver.Findelement(By.id("xyz"));
      Actions actions = new Actions(driver);
      actions.MoveToElement(element);
      actions.Perform();
      //Capture screenshot code goes here

  • @Tmek9210
    @Tmek9210 7 років тому

    Hi,
    I have a below error:
    Cannot convert from 'System.Drawing.Imaging.ImageFormat' to 'OpenQA.Selenium.ScreenshotImageFormat'
    How can I solve this issue?

    • @QuineMcCluskey
      @QuineMcCluskey 6 років тому +1

      You need to change "ImageFormat" by "ScreenshotImageFormat".