Cucumber 4.2: Separate Runner for each browser





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-1















I had implemented Cucumber 4.2 parallel execution for chrome browser only.Now, I want to implement parallel execution for two browsers (Firefox/Chrome). Please provide an example or skeleton so that i can improve from it. Besides, where to search for Cucumber API javadoc?



Chrome Runner:



public class ChromeTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


Firefox Runner:



public class FirefoxTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


This is what I want. Cucumber_Design










share|improve this question

























  • I got no experience at all. I don't know whether this function is implemented by someone already. I not asking somebody to do the job for me.

    – nicholas
    Nov 18 '18 at 3:02













  • I have try to create two runner class, one called ChromeRunner and called Firefox Runner. I"m only can execute one runner at a time using TestNG. How to run it using maven? I'm new to Maven.

    – nicholas
    Nov 19 '18 at 10:44











  • I think i got the answers already by creating testng.xml and execute them as suite in Intellij.

    – nicholas
    Nov 19 '18 at 11:07


















-1















I had implemented Cucumber 4.2 parallel execution for chrome browser only.Now, I want to implement parallel execution for two browsers (Firefox/Chrome). Please provide an example or skeleton so that i can improve from it. Besides, where to search for Cucumber API javadoc?



Chrome Runner:



public class ChromeTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


Firefox Runner:



public class FirefoxTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


This is what I want. Cucumber_Design










share|improve this question

























  • I got no experience at all. I don't know whether this function is implemented by someone already. I not asking somebody to do the job for me.

    – nicholas
    Nov 18 '18 at 3:02













  • I have try to create two runner class, one called ChromeRunner and called Firefox Runner. I"m only can execute one runner at a time using TestNG. How to run it using maven? I'm new to Maven.

    – nicholas
    Nov 19 '18 at 10:44











  • I think i got the answers already by creating testng.xml and execute them as suite in Intellij.

    – nicholas
    Nov 19 '18 at 11:07














-1












-1








-1


1






I had implemented Cucumber 4.2 parallel execution for chrome browser only.Now, I want to implement parallel execution for two browsers (Firefox/Chrome). Please provide an example or skeleton so that i can improve from it. Besides, where to search for Cucumber API javadoc?



Chrome Runner:



public class ChromeTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


Firefox Runner:



public class FirefoxTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


This is what I want. Cucumber_Design










share|improve this question
















I had implemented Cucumber 4.2 parallel execution for chrome browser only.Now, I want to implement parallel execution for two browsers (Firefox/Chrome). Please provide an example or skeleton so that i can improve from it. Besides, where to search for Cucumber API javadoc?



Chrome Runner:



public class ChromeTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


Firefox Runner:



public class FirefoxTestNGParallel {

@Test
public void execute() {
//Main.main(new String{"--threads", "4", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"});
String argv = new String{"--threads", "8", "-p", "timeline:target/cucumber-parallel-report", "-g", "com.peterwkc.step_definitions", "src/main/features"};
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
byte exitstatus = Main.run(argv, contextClassLoader);
}

}


This is what I want. Cucumber_Design







java automated-tests cucumber cucumber-jvm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 10:55







nicholas

















asked Nov 17 '18 at 2:54









nicholasnicholas

43774177




43774177













  • I got no experience at all. I don't know whether this function is implemented by someone already. I not asking somebody to do the job for me.

    – nicholas
    Nov 18 '18 at 3:02













  • I have try to create two runner class, one called ChromeRunner and called Firefox Runner. I"m only can execute one runner at a time using TestNG. How to run it using maven? I'm new to Maven.

    – nicholas
    Nov 19 '18 at 10:44











  • I think i got the answers already by creating testng.xml and execute them as suite in Intellij.

    – nicholas
    Nov 19 '18 at 11:07



















  • I got no experience at all. I don't know whether this function is implemented by someone already. I not asking somebody to do the job for me.

    – nicholas
    Nov 18 '18 at 3:02













  • I have try to create two runner class, one called ChromeRunner and called Firefox Runner. I"m only can execute one runner at a time using TestNG. How to run it using maven? I'm new to Maven.

    – nicholas
    Nov 19 '18 at 10:44











  • I think i got the answers already by creating testng.xml and execute them as suite in Intellij.

    – nicholas
    Nov 19 '18 at 11:07

















I got no experience at all. I don't know whether this function is implemented by someone already. I not asking somebody to do the job for me.

– nicholas
Nov 18 '18 at 3:02







I got no experience at all. I don't know whether this function is implemented by someone already. I not asking somebody to do the job for me.

– nicholas
Nov 18 '18 at 3:02















I have try to create two runner class, one called ChromeRunner and called Firefox Runner. I"m only can execute one runner at a time using TestNG. How to run it using maven? I'm new to Maven.

– nicholas
Nov 19 '18 at 10:44





I have try to create two runner class, one called ChromeRunner and called Firefox Runner. I"m only can execute one runner at a time using TestNG. How to run it using maven? I'm new to Maven.

– nicholas
Nov 19 '18 at 10:44













I think i got the answers already by creating testng.xml and execute them as suite in Intellij.

– nicholas
Nov 19 '18 at 11:07





I think i got the answers already by creating testng.xml and execute them as suite in Intellij.

– nicholas
Nov 19 '18 at 11:07












1 Answer
1






active

oldest

votes


















0














I think you can do this outside Cucumber.



The first part is to configure Cucumber to run with a particular browser using either a command line parameter or the environment.



The second part is to run two (or more cucumber instances at the same time). Basically use virtual machines to do this just run cucumber with different command line parameters to configure the browser.



You could even use a paid service like Circle CI to do this for you.






share|improve this answer
























  • I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

    – nicholas
    Nov 20 '18 at 8:58













  • @peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

    – Kyle Fairns
    Nov 20 '18 at 9:23













  • Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

    – nicholas
    Nov 20 '18 at 13:29











  • Can you provide the Maven command to run two Cucumber instances for different browsers?

    – nicholas
    Nov 21 '18 at 8:47











  • No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

    – diabolist
    Nov 21 '18 at 12:05














Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53347778%2fcucumber-4-2-separate-runner-for-each-browser%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I think you can do this outside Cucumber.



The first part is to configure Cucumber to run with a particular browser using either a command line parameter or the environment.



The second part is to run two (or more cucumber instances at the same time). Basically use virtual machines to do this just run cucumber with different command line parameters to configure the browser.



You could even use a paid service like Circle CI to do this for you.






share|improve this answer
























  • I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

    – nicholas
    Nov 20 '18 at 8:58













  • @peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

    – Kyle Fairns
    Nov 20 '18 at 9:23













  • Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

    – nicholas
    Nov 20 '18 at 13:29











  • Can you provide the Maven command to run two Cucumber instances for different browsers?

    – nicholas
    Nov 21 '18 at 8:47











  • No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

    – diabolist
    Nov 21 '18 at 12:05


















0














I think you can do this outside Cucumber.



The first part is to configure Cucumber to run with a particular browser using either a command line parameter or the environment.



The second part is to run two (or more cucumber instances at the same time). Basically use virtual machines to do this just run cucumber with different command line parameters to configure the browser.



You could even use a paid service like Circle CI to do this for you.






share|improve this answer
























  • I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

    – nicholas
    Nov 20 '18 at 8:58













  • @peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

    – Kyle Fairns
    Nov 20 '18 at 9:23













  • Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

    – nicholas
    Nov 20 '18 at 13:29











  • Can you provide the Maven command to run two Cucumber instances for different browsers?

    – nicholas
    Nov 21 '18 at 8:47











  • No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

    – diabolist
    Nov 21 '18 at 12:05
















0












0








0







I think you can do this outside Cucumber.



The first part is to configure Cucumber to run with a particular browser using either a command line parameter or the environment.



The second part is to run two (or more cucumber instances at the same time). Basically use virtual machines to do this just run cucumber with different command line parameters to configure the browser.



You could even use a paid service like Circle CI to do this for you.






share|improve this answer













I think you can do this outside Cucumber.



The first part is to configure Cucumber to run with a particular browser using either a command line parameter or the environment.



The second part is to run two (or more cucumber instances at the same time). Basically use virtual machines to do this just run cucumber with different command line parameters to configure the browser.



You could even use a paid service like Circle CI to do this for you.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 19 '18 at 11:13









diabolistdiabolist

2,3161712




2,3161712













  • I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

    – nicholas
    Nov 20 '18 at 8:58













  • @peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

    – Kyle Fairns
    Nov 20 '18 at 9:23













  • Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

    – nicholas
    Nov 20 '18 at 13:29











  • Can you provide the Maven command to run two Cucumber instances for different browsers?

    – nicholas
    Nov 21 '18 at 8:47











  • No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

    – diabolist
    Nov 21 '18 at 12:05





















  • I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

    – nicholas
    Nov 20 '18 at 8:58













  • @peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

    – Kyle Fairns
    Nov 20 '18 at 9:23













  • Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

    – nicholas
    Nov 20 '18 at 13:29











  • Can you provide the Maven command to run two Cucumber instances for different browsers?

    – nicholas
    Nov 21 '18 at 8:47











  • No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

    – diabolist
    Nov 21 '18 at 12:05



















I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

– nicholas
Nov 20 '18 at 8:58







I prefer to use Cucumber to implement parallel and Jenkins for CI. I don't want two Cucumber instances though it is a very good idea. What is the purposes of two cucumber instances instead of one?

– nicholas
Nov 20 '18 at 8:58















@peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

– Kyle Fairns
Nov 20 '18 at 9:23







@peterwkc the purpose is to not bloat your codebase with unnecessary parallelisation code. You would have to essentially re-write your code, or cucumber to achieve true parallel tests without using an external script, and so the easiest option is to tackle it from that higher level

– Kyle Fairns
Nov 20 '18 at 9:23















Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

– nicholas
Nov 20 '18 at 13:29





Can you provide a concrete example or link on how to implement Cucumber parallelisation from high level? Thanks.

– nicholas
Nov 20 '18 at 13:29













Can you provide the Maven command to run two Cucumber instances for different browsers?

– nicholas
Nov 21 '18 at 8:47





Can you provide the Maven command to run two Cucumber instances for different browsers?

– nicholas
Nov 21 '18 at 8:47













No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

– diabolist
Nov 21 '18 at 12:05







No thats something you will have to do. I don't use Maven or Java, I cuke with ruby. I don't think Maven is the solution, thats for managing dependencies.

– diabolist
Nov 21 '18 at 12:05






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53347778%2fcucumber-4-2-separate-runner-for-each-browser%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine