Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7954139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:20:07+00:00 2026-06-04T03:20:07+00:00

I have a facebook app which I’d like to test using Watir. The problem

  • 0

I have a facebook app which I’d like to test using Watir.
The problem is I can’t access its divs.
The is located within an iframe.
I can find it and it even says it’s visible.
The problem is I can’t click it (it says it’s invisible when trying)

Can you help please?
I posted my code with a XXX instead of the user name and a different App for Facebook.

Thanks a lot.

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 "https://www.facebook.com/dialog/oauth?client_id=277448022299830&redirect_uri=http%3A//apps.facebook.com/worldoffun/%3Fref%3Dts&canvas=1&fbconnect=0&scope=email,publish_actions"
sleep (2)

if browser.button(:name => 'grant_clicked').exists?
  browser.button(:name => 'grant_clicked').click
  sleep(3)
end
sleep(1)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:20:10+00:00Added an answer on June 4, 2026 at 3:20 am

    That’s because the element you are trying to identify, is not present on that page, try this instead:

      if browser.label(:id => 'grant_clicked').exists?
      browser.label(:id => 'grant_clicked').click
      sleep(3)
    

    I also noticed that the app is in flash, so Watir will not be able to handle flash elements within it, i’d recommend using AutoIt or Project Sikuli together with Watir-Webdriver.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have a client app which can authenticate using Facebook but
I have an app where users can sign up with Facebook, in which case
I have a Facebook app ID which I'm using on 6 iOS apps for
I have a Facebook app with which I'd like to display an image in
I have a FaceBook app in which I use the apprequests API to invite
I have an open-source app which uploads photos to Facebook. To save bandwidth, the
I have a facebook app using a lot of Javascript that doesn't work correctly
I have a Facebook canvas app, written in AS3, and using the Adobe Facebook
We have created a facebook-app which contains a fb:comment field. We have included the
I have a Canvas Facebook app embedded via an iframe. I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.