Using ruby, how can I get webdriver to click on a javascript link?
The link I'm trying to click on is:
<a class="TabOff" href=" javascript:showConfirm('/campustoolshighered/k12_admin_admin_menu.do');">Administration </a>
Would I be able to trigger the javascript with a keyPress event? If so, does anyone know the syntax for doing that? I've had trouble finding a good reference for webdriver -- though I understand that it'll probably get better as it moves out of beta.
I've also looked at firewatir and mechanize. If you have reason to think that one of these would be a better approach then please let me know and why. It needs to be able to click on javascript links and submit form data from a spreadsheet or csv file.
Thanks for the help!
require 'rubygems'
require 'watir-webdriver'
ff=Watir::Browser.new(:firefox)
ff.goto("http://my-web-address")
#Put your user name.
ff.text_field(:name,"user").set("my-username")
#Put your password.
ff.text_field(:name,"pass").set("my-passwd")
#Click Sign In button.
ff.button(:value,"Login").click
#Click on Administration tab. <-- This does not work!!
ff.link(:text, "Administration").click