run test in two different browser tabs or windows

685 views
Skip to first unread message

Vitalii Chepeliuk

unread,
Feb 1, 2016, 4:40:30 AM2/1/16
to NightwatchJs
Hi all! I want to run almost the same test in two different browser windows or browser tabs. I want to check if in 1 tab/windows one DOM element is present and in another tab/windows another DOM element should be shown. Is that possible then to run 2 tests in parallel or 1 test with different DOM elements present in 2 tabs/windows?

KajMagnus

unread,
Feb 1, 2016, 12:05:06 PM2/1/16
to NightwatchJs
Hi,

+1  :-)   I also want to run tests in two different browser windows (not tabs though). I've built a forum + chat, and I'd like to test that messages sent by user no 1, appears for user no 2, and vice versa.

I suspect I need two completely different browsers, e.g. Chrome and FF, or two totally separate instances of Chrome — because each user has its own cookies. So only two different tabs won't work.

(In fact, I might want to start perhaps three or even four browsers. To test many people in the forum/chat at once.)

Best regards, KajMagnus

KajMagnus

unread,
Feb 2, 2016, 12:35:23 AM2/2/16
to NightwatchJs
Hi again,

Vitalii, I think you can open a new tab by following some of the answers here: http://stackoverflow.com/questions/17547473/how-to-open-a-new-tab-using-selenium-webdriver
And then you can switch back and forth between the tabs, as needed, as described here: http://stackoverflow.com/questions/12729265/switch-tabs-using-selenium-webdriver

And, in my case, I can perhaps just use a Bash script that starts two or more different instances of Nightwatch, each controlling their own browser instance and representing one user.

Best regards

Vitalii Chepeliuk

unread,
Feb 2, 2016, 1:50:54 AM2/2/16
to NightwatchJs
Hi KajMagnus! Thanks for response I should try this two options you posted. 

Regards

вівторок, 2 лютого 2016 р. 06:35:23 UTC+1 користувач KajMagnus написав:

KajMagnus

unread,
Feb 4, 2016, 12:36:52 PM2/4/16
to NightwatchJs
Hi Nightwatch people, the feature I had in mind in my case, namely to run many browsers at the same time to test e.g. a chat, is actually available in another project, webdriver.io, and they call it Multiremote, here: http://webdriver.io/guide/usage/multiremote.html

(In case you want to copy it or be inspired by it, or ... not sure, seems like good to know)

Best regards, KajMagnus

[...]

Andrei Rusu

unread,
Feb 10, 2016, 6:57:49 AM2/10/16
to nightw...@googlegroups.com
You can also have a look here:
http://nightwatchjs.org/blog/testing-webrtc-apps-with-nightwatch/
> --
> You received this message because you are subscribed to the Google Groups
> "NightwatchJs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nightwatchjs...@googlegroups.com.
> To post to this group, send email to nightw...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nightwatchjs/5a13cec7-a078-4b9b-a99d-b7a385518dcf%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages