I need a way to take screenshots of my functional tests. Right now I'm using Selenium 2 with C# bindings. I pretty much want to take a screenshot at the end of the test to make sure the desired page is displayed. Are there any particular tools you guys know of that I can incorporate into my C# code that will trigger a screenshot? I couldn't find a built-in Selenium 2 solution (without looking it over).
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
To do screenshots in Selenium 2 you need to do the following
That code should work, as I quickly tested it in IronPython Repl. See the IronPython code below
Using selenium there were two calls I was familiar with:
captureEntirePageScreenshot
andcaptureScreenshot
. You might want to look into those calls to see if they'll accomplish what you're after.System.Drawing
in your solution/project.System.Drawing.Imaging
namespace in your test.Here I am capturing the screen shot of Facebook Home page.
JAVA
use Ashot library to take fullpage screenshots - even where pages needs to be scrolled https://mvnrepository.com/artifact/ru.yandex.qatools.ashot/ashot/1.5.4