mercredi 4 février 2015

protractor - switch to facebook login screen when testing Oauth2

I'm trying to write e2e login test to my application which uses oauth2. when clicking the facbook login- another window opened (the facebook login). I'm trying to enter the credentials there. I'm currently using



browser.driver.switchTo().window();


because it is a new window. I've read that I can get the name of the window by entering 'window.name' in the console. when doing that I got '_e_02MT' I have also tried 'window.document.title' and got 'Facebook' I've tried the different combinations of



browser.driver.switchTo().window('_e_02MT');
browser.switchTo().window('Facebook');
browser.driver.switchTo().window('Facebook');


and so on still can't get to that window. I'm getting the error:



NoSuchWindowError: no such window


any ideas?


thanks.


Aucun commentaire:

Enregistrer un commentaire