On my website, I have a feature where users can authenticate using Facebook. Currently, my site is not public, but you can see a similar process in action at agar.io. Just click on "Login and play" and then click on "Sign in with Facebook". This will open a popup window.
I am able to control the main page easily with Webdriver, but I'm struggling to figure out how to access this popup window using JavaScript. My code looks like this:
var browser = new webdriver.Builder().usingServer().withCapabilities({
'browserName': 'chrome'
}).build();
After initializing the browser object, I can navigate through my site. The challenge now is figuring out how to switch focus from the main page to this popup window so that I can input the user's login credentials.