How to group some features in certain thread and run it parallel in KarateDSL












2















Now I use karatedsl for testing my REST-API, and I want to run some features parallel..
For example I have 5 feature : feature 1, feature 2, feature 3, feature 4 and feature 5...
How to group those features and run it parallel on certain threads, for example I wanna to run feature 1 and feature 2 in thread 1, feature 3 and 4 in thread 2 and feature 3 in thread 3 ???










share|improve this question



























    2















    Now I use karatedsl for testing my REST-API, and I want to run some features parallel..
    For example I have 5 feature : feature 1, feature 2, feature 3, feature 4 and feature 5...
    How to group those features and run it parallel on certain threads, for example I wanna to run feature 1 and feature 2 in thread 1, feature 3 and 4 in thread 2 and feature 3 in thread 3 ???










    share|improve this question

























      2












      2








      2








      Now I use karatedsl for testing my REST-API, and I want to run some features parallel..
      For example I have 5 feature : feature 1, feature 2, feature 3, feature 4 and feature 5...
      How to group those features and run it parallel on certain threads, for example I wanna to run feature 1 and feature 2 in thread 1, feature 3 and 4 in thread 2 and feature 3 in thread 3 ???










      share|improve this question














      Now I use karatedsl for testing my REST-API, and I want to run some features parallel..
      For example I have 5 feature : feature 1, feature 2, feature 3, feature 4 and feature 5...
      How to group those features and run it parallel on certain threads, for example I wanna to run feature 1 and feature 2 in thread 1, feature 3 and 4 in thread 2 and feature 3 in thread 3 ???







      rest api parallel-processing karate






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 9:18









      Yudistira SugandiYudistira Sugandi

      465




      465
























          1 Answer
          1






          active

          oldest

          votes


















          2














          Till karate 0.8.0 you will be able to parallel run tests in feature level (1 feature per thread).



          Running Features in parallel,



          Here is an example from karate documentation:



          @CucumberOptions(tags = {"@smoke"})
          public class TestParallel {

          @Test
          public void testParallel() {
          KarateStats stats = CucumberRunner.parallel(getClass(), 5, "target/surefire-reports");
          assertTrue("scenarios failed", stats.getFailCount() == 0);
          }

          }


          Using this parallel runner you can specify the number of threads you want (which is 5 in the above example).



          More details on parallel execution here -> Parallel Execution in Karate



          Grouping of features:



          You can group feature file using tags like @<tag_name>,



          eg:



          @smoke
          Feature:
          Scenario:
          * print "Smoke"


          similarly, you can add this tag to all the features that you want to group together for execution.



          Now as CucumberOptions in your tests mentions which tag to execute karate will run all the tests which are tagged with that name in parallel.



          More details on Tags: Tags / Grouping



          So, you can define the grouping by tag and parallel execution by
          threads BUT you cannot define which thread should run which
          feature, IMO it looks meaningless.




          Note: If you are planning to use 0.9.0, you
          will be able to run parallel tests in scenario level (each feature will be breakdown into scenarios and run as 1 scenario per thread )and instead of
          CucumberOptions you have to use KarateOptions



          More details on karate 0.9.0 changes : Planned deprecations







          share|improve this answer


























          • why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

            – Yudistira Sugandi
            Nov 24 '18 at 15:34













          • Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

            – Babu Sekaran
            Nov 24 '18 at 15:57








          • 1





            @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

            – Peter Thomas
            Nov 24 '18 at 16:56











          • Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

            – Yudistira Sugandi
            Nov 25 '18 at 2:17











          • @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

            – Yudistira Sugandi
            Nov 25 '18 at 2:21











          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%2f53456782%2fhow-to-group-some-features-in-certain-thread-and-run-it-parallel-in-karatedsl%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









          2














          Till karate 0.8.0 you will be able to parallel run tests in feature level (1 feature per thread).



          Running Features in parallel,



          Here is an example from karate documentation:



          @CucumberOptions(tags = {"@smoke"})
          public class TestParallel {

          @Test
          public void testParallel() {
          KarateStats stats = CucumberRunner.parallel(getClass(), 5, "target/surefire-reports");
          assertTrue("scenarios failed", stats.getFailCount() == 0);
          }

          }


          Using this parallel runner you can specify the number of threads you want (which is 5 in the above example).



          More details on parallel execution here -> Parallel Execution in Karate



          Grouping of features:



          You can group feature file using tags like @<tag_name>,



          eg:



          @smoke
          Feature:
          Scenario:
          * print "Smoke"


          similarly, you can add this tag to all the features that you want to group together for execution.



          Now as CucumberOptions in your tests mentions which tag to execute karate will run all the tests which are tagged with that name in parallel.



          More details on Tags: Tags / Grouping



          So, you can define the grouping by tag and parallel execution by
          threads BUT you cannot define which thread should run which
          feature, IMO it looks meaningless.




          Note: If you are planning to use 0.9.0, you
          will be able to run parallel tests in scenario level (each feature will be breakdown into scenarios and run as 1 scenario per thread )and instead of
          CucumberOptions you have to use KarateOptions



          More details on karate 0.9.0 changes : Planned deprecations







          share|improve this answer


























          • why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

            – Yudistira Sugandi
            Nov 24 '18 at 15:34













          • Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

            – Babu Sekaran
            Nov 24 '18 at 15:57








          • 1





            @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

            – Peter Thomas
            Nov 24 '18 at 16:56











          • Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

            – Yudistira Sugandi
            Nov 25 '18 at 2:17











          • @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

            – Yudistira Sugandi
            Nov 25 '18 at 2:21
















          2














          Till karate 0.8.0 you will be able to parallel run tests in feature level (1 feature per thread).



          Running Features in parallel,



          Here is an example from karate documentation:



          @CucumberOptions(tags = {"@smoke"})
          public class TestParallel {

          @Test
          public void testParallel() {
          KarateStats stats = CucumberRunner.parallel(getClass(), 5, "target/surefire-reports");
          assertTrue("scenarios failed", stats.getFailCount() == 0);
          }

          }


          Using this parallel runner you can specify the number of threads you want (which is 5 in the above example).



          More details on parallel execution here -> Parallel Execution in Karate



          Grouping of features:



          You can group feature file using tags like @<tag_name>,



          eg:



          @smoke
          Feature:
          Scenario:
          * print "Smoke"


          similarly, you can add this tag to all the features that you want to group together for execution.



          Now as CucumberOptions in your tests mentions which tag to execute karate will run all the tests which are tagged with that name in parallel.



          More details on Tags: Tags / Grouping



          So, you can define the grouping by tag and parallel execution by
          threads BUT you cannot define which thread should run which
          feature, IMO it looks meaningless.




          Note: If you are planning to use 0.9.0, you
          will be able to run parallel tests in scenario level (each feature will be breakdown into scenarios and run as 1 scenario per thread )and instead of
          CucumberOptions you have to use KarateOptions



          More details on karate 0.9.0 changes : Planned deprecations







          share|improve this answer


























          • why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

            – Yudistira Sugandi
            Nov 24 '18 at 15:34













          • Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

            – Babu Sekaran
            Nov 24 '18 at 15:57








          • 1





            @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

            – Peter Thomas
            Nov 24 '18 at 16:56











          • Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

            – Yudistira Sugandi
            Nov 25 '18 at 2:17











          • @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

            – Yudistira Sugandi
            Nov 25 '18 at 2:21














          2












          2








          2







          Till karate 0.8.0 you will be able to parallel run tests in feature level (1 feature per thread).



          Running Features in parallel,



          Here is an example from karate documentation:



          @CucumberOptions(tags = {"@smoke"})
          public class TestParallel {

          @Test
          public void testParallel() {
          KarateStats stats = CucumberRunner.parallel(getClass(), 5, "target/surefire-reports");
          assertTrue("scenarios failed", stats.getFailCount() == 0);
          }

          }


          Using this parallel runner you can specify the number of threads you want (which is 5 in the above example).



          More details on parallel execution here -> Parallel Execution in Karate



          Grouping of features:



          You can group feature file using tags like @<tag_name>,



          eg:



          @smoke
          Feature:
          Scenario:
          * print "Smoke"


          similarly, you can add this tag to all the features that you want to group together for execution.



          Now as CucumberOptions in your tests mentions which tag to execute karate will run all the tests which are tagged with that name in parallel.



          More details on Tags: Tags / Grouping



          So, you can define the grouping by tag and parallel execution by
          threads BUT you cannot define which thread should run which
          feature, IMO it looks meaningless.




          Note: If you are planning to use 0.9.0, you
          will be able to run parallel tests in scenario level (each feature will be breakdown into scenarios and run as 1 scenario per thread )and instead of
          CucumberOptions you have to use KarateOptions



          More details on karate 0.9.0 changes : Planned deprecations







          share|improve this answer















          Till karate 0.8.0 you will be able to parallel run tests in feature level (1 feature per thread).



          Running Features in parallel,



          Here is an example from karate documentation:



          @CucumberOptions(tags = {"@smoke"})
          public class TestParallel {

          @Test
          public void testParallel() {
          KarateStats stats = CucumberRunner.parallel(getClass(), 5, "target/surefire-reports");
          assertTrue("scenarios failed", stats.getFailCount() == 0);
          }

          }


          Using this parallel runner you can specify the number of threads you want (which is 5 in the above example).



          More details on parallel execution here -> Parallel Execution in Karate



          Grouping of features:



          You can group feature file using tags like @<tag_name>,



          eg:



          @smoke
          Feature:
          Scenario:
          * print "Smoke"


          similarly, you can add this tag to all the features that you want to group together for execution.



          Now as CucumberOptions in your tests mentions which tag to execute karate will run all the tests which are tagged with that name in parallel.



          More details on Tags: Tags / Grouping



          So, you can define the grouping by tag and parallel execution by
          threads BUT you cannot define which thread should run which
          feature, IMO it looks meaningless.




          Note: If you are planning to use 0.9.0, you
          will be able to run parallel tests in scenario level (each feature will be breakdown into scenarios and run as 1 scenario per thread )and instead of
          CucumberOptions you have to use KarateOptions



          More details on karate 0.9.0 changes : Planned deprecations








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 24 '18 at 16:05

























          answered Nov 24 '18 at 13:06









          Babu SekaranBabu Sekaran

          1,5041215




          1,5041215













          • why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

            – Yudistira Sugandi
            Nov 24 '18 at 15:34













          • Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

            – Babu Sekaran
            Nov 24 '18 at 15:57








          • 1





            @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

            – Peter Thomas
            Nov 24 '18 at 16:56











          • Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

            – Yudistira Sugandi
            Nov 25 '18 at 2:17











          • @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

            – Yudistira Sugandi
            Nov 25 '18 at 2:21



















          • why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

            – Yudistira Sugandi
            Nov 24 '18 at 15:34













          • Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

            – Babu Sekaran
            Nov 24 '18 at 15:57








          • 1





            @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

            – Peter Thomas
            Nov 24 '18 at 16:56











          • Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

            – Yudistira Sugandi
            Nov 25 '18 at 2:17











          • @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

            – Yudistira Sugandi
            Nov 25 '18 at 2:21

















          why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

          – Yudistira Sugandi
          Nov 24 '18 at 15:34







          why is totally meaningless ??? but, thanks for your answer, that's so helpful:D

          – Yudistira Sugandi
          Nov 24 '18 at 15:34















          Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

          – Babu Sekaran
          Nov 24 '18 at 15:57







          Glad it was helpful ;). What is the benefit or purpose of running series of features in a particular thread? do you have any specific requirement like that?

          – Babu Sekaran
          Nov 24 '18 at 15:57






          1




          1





          @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

          – Peter Thomas
          Nov 24 '18 at 16:56





          @YudistiraSugandi agree with Babu - you should never need to know which thread which Scenario is running in which thread, it should be random at run-time. best practice is that one Scenario should never depend on another. in 0.9.0 if you want to run all scenarios in a Feature in sequence you can, but still they can be on different threads.

          – Peter Thomas
          Nov 24 '18 at 16:56













          Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

          – Yudistira Sugandi
          Nov 25 '18 at 2:17





          Now I have 2 features which each feature have 3 scenario.. first scenario for get bill customer information(named as inquiry), second for create transaction, and third for get transaction detail... This feature run sequential, you should run inquiry first before you create transaction, but if you do inquiry twice, the second inquiry will replace first inquiry, so you cannot use first inquiry to create transaction...

          – Yudistira Sugandi
          Nov 25 '18 at 2:17













          @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

          – Yudistira Sugandi
          Nov 25 '18 at 2:21





          @PeterThomas - By the way, in karate version 0.9.0, if I wanna run parallel tests in scenario level, I have to change CucumberOption to KarateOptions in my Runner or test parallel class ?

          – Yudistira Sugandi
          Nov 25 '18 at 2:21


















          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%2f53456782%2fhow-to-group-some-features-in-certain-thread-and-run-it-parallel-in-karatedsl%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

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)