Skip to content

Instantly share code, notes, and snippets.

@tacticiankerala
Created October 8, 2012 08:07
Show Gist options
  • Save tacticiankerala/3851312 to your computer and use it in GitHub Desktop.
Save tacticiankerala/3851312 to your computer and use it in GitHub Desktop.
Ruby Code for running selenium test in firefox through a proxy. We use ZAP as proxy so that we will be notified with possible vulnerabilities exists in our app.
require "selenium-webdriver"
profile = Selenium::WebDriver::Firefox::Profile.new
proxy = Selenium::WebDriver::Proxy.new(:http => "localhost:8080")
profile.proxy = proxy
driver = Selenium::WebDriver.for :firefox , :profile => profile
driver.navigate.to "http://localhost:3000/"
puts driver.title
driver.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment