2

Looking For: I want to run Specs in Parallel.

Tried:

Included in config file:

shardTestFiles : true,
maxInstances: 4 

Output I see:

Multiple instances are not opening. Still running in serial.

**CONFIG.js**
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: {
    'browserName':'chrome',
    'chromeOptions':{'args':['--disable-extensions']},
    shardTestFiles : true,
    maxInstances: 4
},
 onPrepare: function (config_) {                  // before starting the actual TC execution, setup the things we define here
    require('./Data/waitReady.js');
    //browser.manage().window().maximize();

Any help is highly appreciated.

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 '17 at 20:50
  • Thanks Cherree. will try adding as multiple master specs. – keasav rao Sep 20 '17 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 . – keasav rao Sep 26 '17 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 – keasav rao Sep 26 '17 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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