0

enter image description here I am automating facebook signup process with app permission. After facebook login, app permission page is showing on facebook. I want to click on Continue button but not able to click on this button. I am using watir/selenium ruby.

facebook_email.set ("abc@punchh.com")
facebook_pass.set ("test1234")      
facebook_submit.click
@browser.button(:xpath => "//button[@type, 'submit' and text()='Continue as Rohit']").click
orde
  • 5,233
  • 6
  • 31
  • 33
Rohit Doraya
  • 119
  • 1
  • 1
  • 16
  • 1
    "I want to click on Continue button but not able to click on this button." Is there an error? Does it silently fail? Have you inspected the element to make sure it's actually a button? – orde May 11 '18 at 19:27
  • 1
    I have seen this window many a times but I am trying to get that window as possible as I can but I couldn't locate it. If you guide me how to reach this window, I can help you, the above seems to be Javascript window, may be write this code `b.alert.ok`, If it doesn't work, please guide me through anything to reach that page. – Rajagopalan May 11 '18 at 19:57
  • 1
    Can you show us the html structure of this page? – David Knipe May 11 '18 at 20:02
  • I got solution solution for this. This is my updated code: def facebook_signup facebook_link.click @browser.window(:title,/Log in to Facebook | Facebook/i).use do facebook_email.set ("abc@punchh.com") facebook_pass.set ("test1234") facebook_submit.click if (@browser.window(:index => 1).exists?) @browser.window(:index => 1).use do @browser.button(:name => "__CONFIRM__").click end end sleep 10 end end – Rohit Doraya May 11 '18 at 20:11
  • 1
    Update as answer , write as answer . – Rajagopalan May 12 '18 at 02:49
  • I have used index based browser which follows zero based index ordering. Index of default window is "0". As we click on submit button then new window opens whose index is "1". So i have checked that if window with index: 1 present then switch to window with index:1 by using command (@browser.window(:index => 1).use) and execute operation. This works for me. – Rohit Doraya May 12 '18 at 08:23
  • I think you are new to Stack over flow, when you are writing to me, mark my name with @Rajagopalan so that I will be notified. I understood your answer when you were telling me first time, but I am asking you to write as an answer so that people those who are coming to this question will an answer, you can write have an answer to your own question. – Rajagopalan May 12 '18 at 16:43
  • 1
    @Rajagopalan thanks for your suggestion... – Rohit Doraya May 12 '18 at 17:40
  • Not sure if you're using a headless browser, but if you're not, and you use a mac, `cliclick` might be able to help – boulder_ruby May 15 '18 at 22:45

0 Answers0