Context
I am trying the brand new Protractor 0.19.0 with the multiCapabilities config option. It is actually working as described in the docs :
The second point is problematic for me. One of my app doesn't handle multiple connection to the data, implying that the tests fail.
My question is:
Is it possible to limit the maximum number of instances of Webdriver in order to disable parallel testing for this app?
What I have tried
I've found in Selenium Webdriverjs Grid2 wiki that there's a maxSession
parameter that would perfectly fit to my case! But I tried to add it in my Protractor config, without success.
maxSession
is also in the Desired Capabilities. Anyone knows if it's working yet?
Here is the link to the multiCapabilities PR topic, I left a comment there.
If you need more info, feel free to ask :)
Thanks in advance!!
EDIT: Dedicated GitHub issue
EDIT2: I recently tried to add seleniumArgs: ['-maxSession=1']
to my Protractor config, unfortunaltely this doesn't work too...
Implemented in this commit and released in 0.24.0 (See Protractor changelog).
You need to add a maxSessions
option into your protractor config file with a value >=1 (otherwise it is considered as unlimited).
protractor.config.js example:
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
specs: [
'../e2e/**/*.js'
],
multiCapabilities: [
{'browserName': 'chrome'},
{'browserName': 'firefox'},
{'browserName': 'phantomjs'}
],
maxSessions: 1,
baseUrl: 'http://localhost:8000'
};
Tested and working as expected for my case.
I think you can set this by launching selenium nodes in command line and by giving:
MaxInstances
This says....how many instances of same version of browser can run over the Remote System.
or
MaxSession
This says....how many browsers (Any Browser and any version) can run in parallel at a time in the remote system. So this overrides the Max Instances settings and can restrict the number of browser instances that can run in parallel.
from this answer
So you will run your node as such :
java -jar selenium-server-standalone-2.14.0.jar -role node -hub http://******:4444/grid/register -maxSession 5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With