[Noob] How can I switch tab using WebdriverIO

#1

HI,

I would like to open another tab in order to tests differents websites.
If I do something in the first, check the response in the second
I tried to follow this documentation https://codecept.io/helpers/WebDriverIO/#switchtonexttab.

I put this two lines in my file:
I.switchToNextTab();
I.switchToNextTab(2);

I got the following error:
There is no ability to switch to next tab with offset 1

Can you please tell me how to fix it ?

Thanks

0 Likes

#2

You should open a new tab before switching to it.

I.openNewTab()
0 Likes