Selenium WebDriver C# Full Website Screenshots With ChromeDriver and FirefoxDriver

后端 未结 4 1944
北荒
北荒 2020-11-30 05:27

When I take screenshots with ChromeDriver I get screens with the size of my viewport.
When I take screenshots with FirefoxDriver I get what I want, which is a full scree

4条回答
  •  星月不相逢
    2020-11-30 05:36

    It appears as though full-screen screenshots are not yet implemented in the ChromeDriver, due to some inaccuracies in its previous implementation.

    Source: https://code.google.com/p/chromedriver/issues/detail?id=294

    I have recently written a Selenium based application to test an Internet Explorer UI and found that:

    1. Taking screenshots with selenium was not as quick as using .NET, and
    2. Selenium is unable to take screenshots when dialog boxes are present. This was a major drawback, as I needed to identify unexpected dialogs during interaction with the pages.

    Investigate using the Graphics.CopyFromScreen method in System.Drawing as an alternative solution until the feature is implemented in Chrome. Once you have tried .the Net approach however, I don't think you will look back =]

提交回复
热议问题