I practiced with function switchToWindow on codeception. But it doesn't work with me
Anybody can help me resolve my issue. I want to switch to login popup for inputting email/password but i can't. ![enter image description here][1] Here is my scenario On current page (page A) click login button => new window is opened for user inputting email/password of facebook. After click submit button, it will redirect to last window (page A)
Here is my code
$I = new AcceptanceTester($scenario);
$I->amOnPage('/leaderboard');
$I->click('#fb-login');
$I->executeInSelenium(function (\Webdriver\Session $webdriver) {
$handles=$webdriver->window_handles();
$last_window = end($handles);
$webdriver->focusWindow($last_window);
});
$I->fillField('#email','[email protected]');
$I->fillField('#pass','aaa');
$I->click('//*[@id="u_0_1"]');
Thanks