dzharii / swd-recorder

Selenium WebDriver Page Recorder (Page Objects)
MIT License
189 stars 71 forks source link

Is it possible to add option to take current screenshot? #31

Closed sreenadhsr closed 9 years ago

sreenadhsr commented 9 years ago

Selenium allows taking full page screenshot. It will be nice if SWD can give this option in the GUI. I tried to execute following code in WebDriver Playground and it always throws exception.

driver.GetScreenshot().SaveAsFile("c:/test.png", ImageFormat.Png)
2015-04-12 17:32:33.4139 ERROR 'ImageFormat' is undefined Microsoft.ClearScript.ScriptEngineException: 'ImageFormat' is undefined
   at Microsoft.ClearScript.ScriptEngine.ThrowScriptError(IScriptEngineException scriptError)
   at Microsoft.ClearScript.Windows.WindowsScriptEngine.ThrowScriptError(Exception exception)
   at Microsoft.ClearScript.Windows.WindowsScriptEngine.<>c__DisplayClass14.<ScriptInvoke>b__13()
   at Microsoft.ClearScript.ScriptEngine.ScriptInvoke(Action action)
   …
   at Microsoft.ClearScript.ScriptEngine.Evaluate(String code)
   at SwdPageRecorder.UI.PlayGroundPresenter.RunScript(String code)
   at SwdPageRecorder.UI.PlayGroundView.btnRunScript_Click(Object sender, EventArgs e)
   …
   at Microsoft.ClearScript.ScriptEngine.Evaluate(String documentName, String code)
   at Microsoft.ClearScript.ScriptEngine.Evaluate(String code)
   at SwdPageRecorder.UI.PlayGroundPresenter.RunScript(String code)
   at SwdPageRecorder.UI.PlayGroundView.btnRunScript_Click(Object sender, EventArgs e)
  …
dzharii commented 9 years ago

@sreenadhsr, thank you for your feature request & bug report. The feature is implemented in the release SWD PageRecorder 14 APR 2015 v2.45
https://github.com/dzharii/swd-recorder/releases

The bug with driver.GetScreenshot().SaveAsFile("c:/test.png", ImageFormat.Png) is now fixed