Looking For: I want to run Specs in Parallel.


Included in config file:

shardTestFiles : true,
maxInstances: 4 

Output I see:

Multiple instances are not opening. Still running in serial.

exports.config = {
framework: 'jasmine2',      //framework Used
seleniumPort: 4444,         // selenium port address
specs: ['./Spec/Master.spec.js'],      //inside this i have 50 Specs
allScriptsTimeout: 50000,
jasmineNodeOpts: {                   //jasmine framework details
    isVerbose: true,
    showColors: true,
    includeStackTrace: true,
    defaultTimeoutInterval: 260000,
    print: function() {}

capabilities: {
    shardTestFiles : true,
    maxInstances: 4
 onPrepare: function (config_) {                  // before starting the actual TC execution, setup the things we define here

Any help is highly appreciated.

  • it's 2020 and I am having same issue. Did you resolve it?
    – Syed Ali
    Nov 19, 2020 at 22:50

1 Answer 1


As far as I understand this sort of parallel test running, I believe "shardTestFiles" will run test files in parallel but if a test file has multiple test cases those will run sequentially on a single browser instance. With your single spec file I would not expect parallel execution when running your config. However, were you to split them up into 4 test files (ex: Master[0-3].spec.js) I would expect to see a test case from each file start at the same time. There's a comment in the config specification that might be helpful to you https://github.com/angular/protractor/blob/master/lib/config.ts#L295 .

  • 1
    That's exactly why I've asked this question in the comment :)
    – alecxe
    Sep 19, 2017 at 20:50
  • Thanks Cherree. will try adding as multiple master specs.
    – Bustaq
    Sep 20, 2017 at 9:40
  • @cherree ,alecxe . i added 2 specs in config (//specs: ['Spec/Master_Specs/Master.spec.js','Spec/Master_Specs/FindAcc_MasterSpecs.js'],). 2 instances are opening, but 1st spec runs in both instances, after spec 1 is done. 1 instance is opened to run 2nd spec. QUESTION : Why duplicate is running in two instances .
    – Bustaq
    Sep 26, 2017 at 10:51
  • My requirement is , two specs to run in 2 instances and not duplicate running in both instances . Any Helps . Thanks in Advance
    – Bustaq
    Sep 26, 2017 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.