-2

I am implementing facebook login automation on my site using night watch.I am successfully able to opening facebook login window in popup but can't able to access popup window using night watch

please help me

1 Answers1

0

I've been using the following in my tests. You need to explicitly change focus to the pop up window in your script.

.window_handles(function(result) {     // Since two windows are open we need    to get the window ids
    var temp = result.value[1];          //
    this.switchWindow(temp);             // and switch focus to the new window so that the next command is run against it
  })                                     //

to switch focus back to the the original window you can use the following

.window_handles(function(result) {     // Since two windows are open we need to get the window ids
    var temp = result.value[0];          //
    this.switchWindow(temp);             // and switch focus to the new window so that the next command is run against it
  })                                     //