-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid browser restart (Strategies / Pitfalls) #117
Comments
That's not currently possible unfortunately but it would make a valuable addition to have an option to reuse browser session, because in some cases that might not be desired. |
Ok, I'll give it a try. |
So i'm in the middle of trying stuff, just to see if that would make sense :
Do you think I'm on the right track ? |
And investigating a bit more, it seems like closing the selenium session is also done by using the 'end' function in a test (as seen in client-commands.js). I (naively) tried to avoid calling the 'delete' command, but then the test runner never passes to the rest of the test, I'm not exactly sure why : Original 'end' function :
My best guess (not sure what the flow of commands is)
|
Maybe running tests parallel would increase the speed... In order to do that we need a parallel test runner... Currently 1 test is 11 secs by me, and opening a new ff tab is 10 secs of 11... |
Hmm according to this: http://sqa.stackexchange.com/questions/1988/selenium-reuse-existing-browser-session-instead-of-opening-new-windows |
Yes, it is possible but it needs to be implemented and made configurable On Tue, Apr 29, 2014 at 6:07 PM, Jánszky László Lajos <
|
Any progress on that? |
Any updates? Also how did you accomplish
if you don't mind my asking? |
+1 |
Nope, I don't have any progress to report here (I haven't been working on that for a while.) Sorry. |
+1 |
3 similar comments
+1 |
+1 |
+1 |
@beatfactor any updates on when/if this might be coming? I actually tried to step through the code and try to see how things worked and maybe even attempt to work on this myself but it seemed pretty complex and I don't want to spend time working on something that someone else has plans to do. |
Yeah, this would be a cool feature. Maybe you can use the new |
👍 |
This is the only thing keeping us from adopting Nightwatch on our rig. We think it's awesome but starting a new session for every test file seems overkill and extremely time consuming. If I only had the kung-fu necessary to get this done... 🙉 Has anyone found a way around this - or managed to run different files through a single Test Suite (which would circumvent the session problem)? |
@dreamyguy if keeping run time low is what you're after you can use the new parallel run feature - might be faster than running your tests serially + reusing browser session |
We'd find this a helpful feature as well: we run our tests on CI, and run into port contention between different CI jobs. Having a single selenium session would ensure that once we have a port we can hold on to it. |
+1 |
2 similar comments
+1 |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
I have come up with a solution that runs all the tests in one browser session. It does not solve the problem but it did the trick for me: The idea is to flatten all tests to one folder, require every file in a single one and run Nightwatch against that file. In this case I'll make those requires more elegant by getting all filenames in that folder and iterating through them, instead of explicitly declaring each. Then I think the setup will be pretty robust. |
+1 |
Thanks everyone for input. This has been open for far too long and no resolution is in sight, so it's time to close. |
Hi
Launching a folder of nightwatch tests modules typically launches a new browser for each test, making them longer than ideal.
Would that make sense to try and launch all tests using the same browser session ? Are there any "known" strategies to avoid this (ceating the browser in a global setUp / tearDown ?)
Thanks
The text was updated successfully, but these errors were encountered: