Cucumber-jvm @after with Appium driver
I'm using cucumber-jvm
, and trying to implement global @After
method which should be executed only once after all scenario's execution was completed.
The @After
method should quit the appium driver.
Currently @After
hook being executed after each running scenario , and it means that the driver should be created each time from scratch , but I do want to reuse it.
Any help will be much appreciated
appium hook cucumber-jvm
add a comment |
I'm using cucumber-jvm
, and trying to implement global @After
method which should be executed only once after all scenario's execution was completed.
The @After
method should quit the appium driver.
Currently @After
hook being executed after each running scenario , and it means that the driver should be created each time from scratch , but I do want to reuse it.
Any help will be much appreciated
appium hook cucumber-jvm
Use a jvm shutdown hook instead to close the appium driver.
– Grasshopper
Jan 1 at 8:11
are you executing sequentially?
– niharika_neo
Jan 2 at 3:59
Maybe this question could help.
– troig
Jan 2 at 11:39
add a comment |
I'm using cucumber-jvm
, and trying to implement global @After
method which should be executed only once after all scenario's execution was completed.
The @After
method should quit the appium driver.
Currently @After
hook being executed after each running scenario , and it means that the driver should be created each time from scratch , but I do want to reuse it.
Any help will be much appreciated
appium hook cucumber-jvm
I'm using cucumber-jvm
, and trying to implement global @After
method which should be executed only once after all scenario's execution was completed.
The @After
method should quit the appium driver.
Currently @After
hook being executed after each running scenario , and it means that the driver should be created each time from scratch , but I do want to reuse it.
Any help will be much appreciated
appium hook cucumber-jvm
appium hook cucumber-jvm
edited Jan 1 at 7:24


Al Imran
703418
703418
asked Dec 31 '18 at 20:29


IgalIgal
1,552122952
1,552122952
Use a jvm shutdown hook instead to close the appium driver.
– Grasshopper
Jan 1 at 8:11
are you executing sequentially?
– niharika_neo
Jan 2 at 3:59
Maybe this question could help.
– troig
Jan 2 at 11:39
add a comment |
Use a jvm shutdown hook instead to close the appium driver.
– Grasshopper
Jan 1 at 8:11
are you executing sequentially?
– niharika_neo
Jan 2 at 3:59
Maybe this question could help.
– troig
Jan 2 at 11:39
Use a jvm shutdown hook instead to close the appium driver.
– Grasshopper
Jan 1 at 8:11
Use a jvm shutdown hook instead to close the appium driver.
– Grasshopper
Jan 1 at 8:11
are you executing sequentially?
– niharika_neo
Jan 2 at 3:59
are you executing sequentially?
– niharika_neo
Jan 2 at 3:59
Maybe this question could help.
– troig
Jan 2 at 11:39
Maybe this question could help.
– troig
Jan 2 at 11:39
add a comment |
1 Answer
1
active
oldest
votes
You can try using QAF which support Gherkin, where driver management is taken care by the framework. It is dedicated framework built upon TestNG for web, mobile web, mobile native, and webservices functional test automation.
When using QAF you don't need to write any code to setup/teardown driver. You can configure as per your need through testng xml configuration file and properties. You can specify behavior by using property selenium.singletone
. For example:
#will reuse driver session for close browser after all testcase configured under xml test node
selenium.singletone=true
#will teardown after each scenario/testcase
selenium.singletone=Method
#will reuse driver session for group
selenium.singletone=Groups
If you are running in parrallel it will you can have driver session sharing between test running in same thread. All combinations you can achieve through execution configuration.
Moreover, you can use all TestNG listener and annotations. For example:
@BeforeMethod
:Invokes Before each Testcase/Scenario
@BeforeSuite
: Invokes once before entire suite
@BeforeTest
: Invokes once before each xml test node for each xml test node in configuration
@BeforeGroup
: Invokes once before starting execution of test in group for each group
@AfterSuite
: Invokes once after entire suite
@AfterTest
: Invokes once after entire xml test node
@AfterGroup
:Invokes once after all test in group for each group
@AfterMethod
:Invokes after each Testcase/Scenario
Refer Gherkin with QAF
add a comment |
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%2f53991190%2fcucumber-jvm-after-with-appium-driver%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
You can try using QAF which support Gherkin, where driver management is taken care by the framework. It is dedicated framework built upon TestNG for web, mobile web, mobile native, and webservices functional test automation.
When using QAF you don't need to write any code to setup/teardown driver. You can configure as per your need through testng xml configuration file and properties. You can specify behavior by using property selenium.singletone
. For example:
#will reuse driver session for close browser after all testcase configured under xml test node
selenium.singletone=true
#will teardown after each scenario/testcase
selenium.singletone=Method
#will reuse driver session for group
selenium.singletone=Groups
If you are running in parrallel it will you can have driver session sharing between test running in same thread. All combinations you can achieve through execution configuration.
Moreover, you can use all TestNG listener and annotations. For example:
@BeforeMethod
:Invokes Before each Testcase/Scenario
@BeforeSuite
: Invokes once before entire suite
@BeforeTest
: Invokes once before each xml test node for each xml test node in configuration
@BeforeGroup
: Invokes once before starting execution of test in group for each group
@AfterSuite
: Invokes once after entire suite
@AfterTest
: Invokes once after entire xml test node
@AfterGroup
:Invokes once after all test in group for each group
@AfterMethod
:Invokes after each Testcase/Scenario
Refer Gherkin with QAF
add a comment |
You can try using QAF which support Gherkin, where driver management is taken care by the framework. It is dedicated framework built upon TestNG for web, mobile web, mobile native, and webservices functional test automation.
When using QAF you don't need to write any code to setup/teardown driver. You can configure as per your need through testng xml configuration file and properties. You can specify behavior by using property selenium.singletone
. For example:
#will reuse driver session for close browser after all testcase configured under xml test node
selenium.singletone=true
#will teardown after each scenario/testcase
selenium.singletone=Method
#will reuse driver session for group
selenium.singletone=Groups
If you are running in parrallel it will you can have driver session sharing between test running in same thread. All combinations you can achieve through execution configuration.
Moreover, you can use all TestNG listener and annotations. For example:
@BeforeMethod
:Invokes Before each Testcase/Scenario
@BeforeSuite
: Invokes once before entire suite
@BeforeTest
: Invokes once before each xml test node for each xml test node in configuration
@BeforeGroup
: Invokes once before starting execution of test in group for each group
@AfterSuite
: Invokes once after entire suite
@AfterTest
: Invokes once after entire xml test node
@AfterGroup
:Invokes once after all test in group for each group
@AfterMethod
:Invokes after each Testcase/Scenario
Refer Gherkin with QAF
add a comment |
You can try using QAF which support Gherkin, where driver management is taken care by the framework. It is dedicated framework built upon TestNG for web, mobile web, mobile native, and webservices functional test automation.
When using QAF you don't need to write any code to setup/teardown driver. You can configure as per your need through testng xml configuration file and properties. You can specify behavior by using property selenium.singletone
. For example:
#will reuse driver session for close browser after all testcase configured under xml test node
selenium.singletone=true
#will teardown after each scenario/testcase
selenium.singletone=Method
#will reuse driver session for group
selenium.singletone=Groups
If you are running in parrallel it will you can have driver session sharing between test running in same thread. All combinations you can achieve through execution configuration.
Moreover, you can use all TestNG listener and annotations. For example:
@BeforeMethod
:Invokes Before each Testcase/Scenario
@BeforeSuite
: Invokes once before entire suite
@BeforeTest
: Invokes once before each xml test node for each xml test node in configuration
@BeforeGroup
: Invokes once before starting execution of test in group for each group
@AfterSuite
: Invokes once after entire suite
@AfterTest
: Invokes once after entire xml test node
@AfterGroup
:Invokes once after all test in group for each group
@AfterMethod
:Invokes after each Testcase/Scenario
Refer Gherkin with QAF
You can try using QAF which support Gherkin, where driver management is taken care by the framework. It is dedicated framework built upon TestNG for web, mobile web, mobile native, and webservices functional test automation.
When using QAF you don't need to write any code to setup/teardown driver. You can configure as per your need through testng xml configuration file and properties. You can specify behavior by using property selenium.singletone
. For example:
#will reuse driver session for close browser after all testcase configured under xml test node
selenium.singletone=true
#will teardown after each scenario/testcase
selenium.singletone=Method
#will reuse driver session for group
selenium.singletone=Groups
If you are running in parrallel it will you can have driver session sharing between test running in same thread. All combinations you can achieve through execution configuration.
Moreover, you can use all TestNG listener and annotations. For example:
@BeforeMethod
:Invokes Before each Testcase/Scenario
@BeforeSuite
: Invokes once before entire suite
@BeforeTest
: Invokes once before each xml test node for each xml test node in configuration
@BeforeGroup
: Invokes once before starting execution of test in group for each group
@AfterSuite
: Invokes once after entire suite
@AfterTest
: Invokes once after entire xml test node
@AfterGroup
:Invokes once after all test in group for each group
@AfterMethod
:Invokes after each Testcase/Scenario
Refer Gherkin with QAF
answered Jan 4 at 20:07
user861594user861594
2,90131931
2,90131931
add a comment |
add a comment |
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%2f53991190%2fcucumber-jvm-after-with-appium-driver%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
Use a jvm shutdown hook instead to close the appium driver.
– Grasshopper
Jan 1 at 8:11
are you executing sequentially?
– niharika_neo
Jan 2 at 3:59
Maybe this question could help.
– troig
Jan 2 at 11:39