Skip to content
This repository

Expose .getScreenshotAs in Clojure #14

locopati opened this Issue November 09, 2011 · 2 comments

2 participants

locopati Daniel Gregoire

In 0.4.x, to get a screenshot, you need to do something like

(def drv (start :firefox ""))
(.getScreenshotAs (:webdriver drv) org.openqa.selenium.OutputType/FILE)

This is a flawed approach for any number of reasons...

  • not checking if TakesScreenshot is impl by the driver
  • relies on the underlying clojure driver implementation
  • exposes Selenium API

Would be great if this functionality were exposed as a clj-webdriver function
screenshot [driver] -> bytes
screenshot [driver string|File] -> file(where string would create the file first)

Daniel Gregoire

I'm happy to add screenshot functionality. As I recall, when I first developed clj-webdriver, only Firefox had screenshot support, which is why it has not been part of the API. Thanks for drawing my attention to this omission.

Daniel Gregoire

Just to set expectations on this, I plan to include this addition to the API for the 0.5.x release, which I hope to have out in the next couple of weeks (doing a rather large re-work of how HTML elements are handled).

Daniel Gregoire semperos closed this in a52070f November 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.