0

I am trying to detect when a Facebook pop-up is displayed to then fill out the Facebook login form. I have tried the attach method, also the wait method, and the sleep method but it seems that as soon as I launch the new page all connection is lost:

 #this output is displayed
 puts "lets the game begingsx"
 $b.goto("javascript:gigya.services.socialize.plugins.login.providerClick('loginPluginDiv','facebook')")

 #this output is never displayed
 puts "lets start sleep"

 $b.window(:title,/Log In | Facebook/i).use do
   $b.text_field(:id => 'email').when_present.set("xyz@gmail.com")
 end
4

2 に答える 2

0

Here is how you can use newly opened/pop-up window

@my_browser = Watir::Browser.new
@my_browser.goto "your first url"

When you get facebook pop-up then do the following to perform actions on the pop-up window. I am assuming that you now the title on the facebook popup

@my_browser.window(:title => "facebook login popup title").use do
  @my_browser.button(:id => "yout buttone id").click
end

I hope it will help

于 2012-09-27T09:01:39.957 に答える
0

The problem is that you are using wrong title for Facebook login page. Page title is in html element. So use this construct

@browser.window(:title => 'Facebook').wait_until_present
@browser.window(:title => 'Facebook').use do

end

Regards, Karlo.

于 2013-05-29T15:04:24.710 に答える