Skip to content
Aldrin Martoq edited this page May 4, 2016 · 1 revision

One of the goals of Webdrone is to be used in automatic QA testing. For this, it is esencial to keep evidences.

By default, Webdrone will create an output directory/folder where it will save screenshots and downloaded files. The folder name has the year and time when the script is run, like this: webdrone_output/YYYYMMDD_hhmmss.

To customize this folder, use the outdir: parameter. You can get the name of the folder in your scripts, calling a0.conf.outdir.

a0 = Webdrone.create timeout: 10, browser: :safari, outdir: "/tmp/evidences/#{Time.new.strftime('%Y%m%d-%H%M%S')}/"
puts a0.conf.outdir                  # prints /tmp/evidences/20160504-145804

To take a screenshot, use a0.shot.screen with a name. All screenshot files are saved in PNG format and enumerated from 0001 up to 9999. Also by default, an screenshot is generated whenever an exception occurs.

a0.shot.screen        'login'        # saves to screenshot-0001-login.png
a0.shot.screen        'home'         # saves to screenshot-0002-home.png

If the browser supports it, any downloaded file will be saved in the same outdir folder.

Clone this wiki locally