I'm testing a payment process flow.
This is the interaction overview:
- user makes his order on our site
- after selecting payment provider, new window is opened with payment providers website (this is controlled by payment provider)
- user fills out his payment details on site of payment provider
- the last button click on payment providers website causes the window to be closed (this is where the problem is)
- we get confirmation form payment provider on the background
- user is being taken back to our site
Everything works fine, except when the window gets automatically closed as the last step of the flow by payment provider. I get a warning inside selenium server:
WARN - Exception: Window not found. The browser window may have been closed.
and an error inside codeception output:
Window not found. The browser window may have been closed.
I'm switching to the window of payment provider by:
The problem is caused by clicking a 'confirm' button on payment providers site which causes the window to get closed like this:
$I->click('.form-submitter'); // now the window is gone
Is there anything I can do to prevent this error?
Is there a way to expect the window to get closed?