How to group some features in certain thread and run it parallel in KarateDSL
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
add a comment |
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
add a comment |
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
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
rest api parallel-processing karate
asked Nov 24 '18 at 9:18
Yudistira SugandiYudistira Sugandi
465
465
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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 useKarateOptions
More details on karate 0.9.0 changes : Planned deprecations
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 whichScenario
is running in which thread, it should be random at run-time. best practice is that oneScenario
should never depend on another. in 0.9.0 if you want to run all scenarios in aFeature
in sequence you can, but still they can be on different threads.
– Peter Thomas
Nov 24 '18 at 16:56
Now I have 2features
which eachfeature
have 3scenario
.. firstscenario
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
|
show 2 more comments
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 useKarateOptions
More details on karate 0.9.0 changes : Planned deprecations
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 whichScenario
is running in which thread, it should be random at run-time. best practice is that oneScenario
should never depend on another. in 0.9.0 if you want to run all scenarios in aFeature
in sequence you can, but still they can be on different threads.
– Peter Thomas
Nov 24 '18 at 16:56
Now I have 2features
which eachfeature
have 3scenario
.. firstscenario
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
|
show 2 more comments
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 useKarateOptions
More details on karate 0.9.0 changes : Planned deprecations
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 whichScenario
is running in which thread, it should be random at run-time. best practice is that oneScenario
should never depend on another. in 0.9.0 if you want to run all scenarios in aFeature
in sequence you can, but still they can be on different threads.
– Peter Thomas
Nov 24 '18 at 16:56
Now I have 2features
which eachfeature
have 3scenario
.. firstscenario
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
|
show 2 more comments
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 useKarateOptions
More details on karate 0.9.0 changes : Planned deprecations
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 useKarateOptions
More details on karate 0.9.0 changes : Planned deprecations
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 whichScenario
is running in which thread, it should be random at run-time. best practice is that oneScenario
should never depend on another. in 0.9.0 if you want to run all scenarios in aFeature
in sequence you can, but still they can be on different threads.
– Peter Thomas
Nov 24 '18 at 16:56
Now I have 2features
which eachfeature
have 3scenario
.. firstscenario
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
|
show 2 more comments
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 whichScenario
is running in which thread, it should be random at run-time. best practice is that oneScenario
should never depend on another. in 0.9.0 if you want to run all scenarios in aFeature
in sequence you can, but still they can be on different threads.
– Peter Thomas
Nov 24 '18 at 16:56
Now I have 2features
which eachfeature
have 3scenario
.. firstscenario
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
|
show 2 more comments
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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