Clicking on links within facebook iframes (facebook apps)

Hello,

I have a problem with clicking on the links in facebook apps due to
iframes. I am trying to write a little script to run through the funwall
app.

I used IE Dev toolbar to get the name of the id of the iframe (those
iframes how no name attribute). So I run this command:

$ie.frame(:id, “app2378983609_fb_frame”).link(:text, ‘View this
post’).click

And I get this:

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/frame.rb:52:in
`method_missing’: document (WIN32OLERuntimeError)
OLE error code:80070005 in
Access is denied.

HRESULT error code:0x80020009
  Exception occurred.       from

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/frame.rb:52:in
document' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/locator.rb:31:ineach_element’
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/locator.rb:40:in
locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/container.rb:830:inlocate_tagged_element’
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/link.rb:24:in
locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:47:inassert_exists’
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:281:in
enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:53:inassert_enabled’
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:226:in
click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:212:inclick’
from C:/watir/FunwallPost.rb:28

Does anyone know how to get around this?

Any help would be appreciated.
Thanks.

Hi,

Not sure if I understand your question.

If you have a link inside an iframe in your facebook app and you want
it to make your app go to another page, just add

:target=>“_top”

to your link_to call. You don’t need to name the iframe specifically.

Vidal.

On Jun 2, 5:41 pm, Ruben Z. [email protected]