I have a facebook app which I’d like to test using Watir.
problem is I can’t access one of it’s divs.
the is located within an iframe.
I can find it and it even says it’s visible.
problem is I can’t click it (it says it’s invisible when trying)
can you please help?
I posted my code with a XXX instead of the user name and a different App
for facebook.
require “watir-webdriver”
browser = Watir::Browser.new
browser.goto “http://www.facebook.com”
sleep(2)
if browser.text_field(:id => ‘pass’).exists?
browser.text_field(:id => ‘email’).set ‘XXXXXXXXX’
browser.text_field(:id => ‘pass’).set ‘ZZZZZZZ’
browser.button(:value => ‘Log In’).click
end
sleep(2)
browser.text_field(:id => ‘q’).set ‘World Of Fun’
browser.send_keys :enter
sleep (2)
browser.goto
“Log into Facebook | Facebook”
sleep (2)
if browser.button(:name => ‘grant_clicked’).exists?
browser.button(:name => ‘grant_clicked’).click
sleep(3)
end
sleep(1)