Skip to content

Instantly share code, notes, and snippets.

@ivanacostarubio
Created September 17, 2010 00:39
Show Gist options
  • Select an option

  • Save ivanacostarubio/583448 to your computer and use it in GitHub Desktop.

Select an option

Save ivanacostarubio/583448 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'capybara'
require 'capybara/dsl'
Capybara.current_driver = :selenium
Capybara.app_host = 'http://www.fpl.com'
Capybara.run_server = false
class FPL
include Capybara
def pay
visit('https://app.fpl.com/eca/EcaController')
fill_in "userid", :with => "YOUR_LOGIN"
fill_in "password", :with => "YOUR_PASSWORD"
click_button "Log In"
click_link("Pay Bill")
choose("totalDueAmount")
fill_in "requested_by", :with => "YOUR_NAME"
click_link("Accept Terms & Conditions")
click_link("OK")
end
end
runner = FPL.new
runner.pay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment