TestNG running on different threads when using timeout, Is there a possibility we can use same thread
I am trying to create a threadLocal webdriver.
Trying to initialize and login into over application in @BeforeClass.
@test is having functionality. This test is working properly but whenever i use @test(timeOut=1200) it is getting failed due to timeOut's in Testng run on a different thread.
But whenever there is a timeOut in the @test(timeOut=1200) TestNG is creating Two new thread for the @beforeclass and @test.
Is there a possibility that it will run in a single thread.
I have tried TestNG-7.0.0-beta1 with -Dtestng.thread.affinity=true JVM agrument.
But it stills fails to fulfill my requirement.
Thanks,
balraj
selenium-webdriver testng testng-dataprovider testng-eclipse
add a comment |
I am trying to create a threadLocal webdriver.
Trying to initialize and login into over application in @BeforeClass.
@test is having functionality. This test is working properly but whenever i use @test(timeOut=1200) it is getting failed due to timeOut's in Testng run on a different thread.
But whenever there is a timeOut in the @test(timeOut=1200) TestNG is creating Two new thread for the @beforeclass and @test.
Is there a possibility that it will run in a single thread.
I have tried TestNG-7.0.0-beta1 with -Dtestng.thread.affinity=true JVM agrument.
But it stills fails to fulfill my requirement.
Thanks,
balraj
selenium-webdriver testng testng-dataprovider testng-eclipse
Can you try this@Test(timeOut=1000) // specify time in milliseconds
– Manoj Kengudelu
Nov 14 '18 at 12:50
sorry manoj that is not what i required anyways thanks for the help
– balraj dacha
Nov 15 '18 at 9:10
add a comment |
I am trying to create a threadLocal webdriver.
Trying to initialize and login into over application in @BeforeClass.
@test is having functionality. This test is working properly but whenever i use @test(timeOut=1200) it is getting failed due to timeOut's in Testng run on a different thread.
But whenever there is a timeOut in the @test(timeOut=1200) TestNG is creating Two new thread for the @beforeclass and @test.
Is there a possibility that it will run in a single thread.
I have tried TestNG-7.0.0-beta1 with -Dtestng.thread.affinity=true JVM agrument.
But it stills fails to fulfill my requirement.
Thanks,
balraj
selenium-webdriver testng testng-dataprovider testng-eclipse
I am trying to create a threadLocal webdriver.
Trying to initialize and login into over application in @BeforeClass.
@test is having functionality. This test is working properly but whenever i use @test(timeOut=1200) it is getting failed due to timeOut's in Testng run on a different thread.
But whenever there is a timeOut in the @test(timeOut=1200) TestNG is creating Two new thread for the @beforeclass and @test.
Is there a possibility that it will run in a single thread.
I have tried TestNG-7.0.0-beta1 with -Dtestng.thread.affinity=true JVM agrument.
But it stills fails to fulfill my requirement.
Thanks,
balraj
selenium-webdriver testng testng-dataprovider testng-eclipse
selenium-webdriver testng testng-dataprovider testng-eclipse
edited Nov 15 '18 at 11:17
balraj dacha
asked Nov 14 '18 at 12:33
balraj dachabalraj dacha
64
64
Can you try this@Test(timeOut=1000) // specify time in milliseconds
– Manoj Kengudelu
Nov 14 '18 at 12:50
sorry manoj that is not what i required anyways thanks for the help
– balraj dacha
Nov 15 '18 at 9:10
add a comment |
Can you try this@Test(timeOut=1000) // specify time in milliseconds
– Manoj Kengudelu
Nov 14 '18 at 12:50
sorry manoj that is not what i required anyways thanks for the help
– balraj dacha
Nov 15 '18 at 9:10
Can you try this
@Test(timeOut=1000) // specify time in milliseconds
– Manoj Kengudelu
Nov 14 '18 at 12:50
Can you try this
@Test(timeOut=1000) // specify time in milliseconds
– Manoj Kengudelu
Nov 14 '18 at 12:50
sorry manoj that is not what i required anyways thanks for the help
– balraj dacha
Nov 15 '18 at 9:10
sorry manoj that is not what i required anyways thanks for the help
– balraj dacha
Nov 15 '18 at 9:10
add a comment |
1 Answer
1
active
oldest
votes
As of the latest released version of TestNG viz., 7.0.0-beta1
, this is currently not supported within TestNG. Whenever you specify a timeout
attribute for an @Test
method, TestNG spawns it in a separate thread so that it can enforce timeouts.
But this behavior is applicable only for the @Test
method and not for
- the listeners (either the
IInvokedMethodListener
providedbeforeInvocation()
(or)afterInvocation()
) (or) - for the configuration methods such as
@BeforeMethod
(or)@AfterMethod
annotated configurations
[ These are the only set of methods which TestNG usually runs on the same thread as the @Test
method ].
This issue as you are also aware is being tracked via https://github.com/cbeust/testng/issues/914
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%2f53300354%2ftestng-running-on-different-threads-when-using-timeout-is-there-a-possibility-w%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
As of the latest released version of TestNG viz., 7.0.0-beta1
, this is currently not supported within TestNG. Whenever you specify a timeout
attribute for an @Test
method, TestNG spawns it in a separate thread so that it can enforce timeouts.
But this behavior is applicable only for the @Test
method and not for
- the listeners (either the
IInvokedMethodListener
providedbeforeInvocation()
(or)afterInvocation()
) (or) - for the configuration methods such as
@BeforeMethod
(or)@AfterMethod
annotated configurations
[ These are the only set of methods which TestNG usually runs on the same thread as the @Test
method ].
This issue as you are also aware is being tracked via https://github.com/cbeust/testng/issues/914
add a comment |
As of the latest released version of TestNG viz., 7.0.0-beta1
, this is currently not supported within TestNG. Whenever you specify a timeout
attribute for an @Test
method, TestNG spawns it in a separate thread so that it can enforce timeouts.
But this behavior is applicable only for the @Test
method and not for
- the listeners (either the
IInvokedMethodListener
providedbeforeInvocation()
(or)afterInvocation()
) (or) - for the configuration methods such as
@BeforeMethod
(or)@AfterMethod
annotated configurations
[ These are the only set of methods which TestNG usually runs on the same thread as the @Test
method ].
This issue as you are also aware is being tracked via https://github.com/cbeust/testng/issues/914
add a comment |
As of the latest released version of TestNG viz., 7.0.0-beta1
, this is currently not supported within TestNG. Whenever you specify a timeout
attribute for an @Test
method, TestNG spawns it in a separate thread so that it can enforce timeouts.
But this behavior is applicable only for the @Test
method and not for
- the listeners (either the
IInvokedMethodListener
providedbeforeInvocation()
(or)afterInvocation()
) (or) - for the configuration methods such as
@BeforeMethod
(or)@AfterMethod
annotated configurations
[ These are the only set of methods which TestNG usually runs on the same thread as the @Test
method ].
This issue as you are also aware is being tracked via https://github.com/cbeust/testng/issues/914
As of the latest released version of TestNG viz., 7.0.0-beta1
, this is currently not supported within TestNG. Whenever you specify a timeout
attribute for an @Test
method, TestNG spawns it in a separate thread so that it can enforce timeouts.
But this behavior is applicable only for the @Test
method and not for
- the listeners (either the
IInvokedMethodListener
providedbeforeInvocation()
(or)afterInvocation()
) (or) - for the configuration methods such as
@BeforeMethod
(or)@AfterMethod
annotated configurations
[ These are the only set of methods which TestNG usually runs on the same thread as the @Test
method ].
This issue as you are also aware is being tracked via https://github.com/cbeust/testng/issues/914
answered Nov 18 '18 at 6:46
Krishnan MahadevanKrishnan Mahadevan
8,63531643
8,63531643
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%2f53300354%2ftestng-running-on-different-threads-when-using-timeout-is-there-a-possibility-w%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
Can you try this
@Test(timeOut=1000) // specify time in milliseconds
– Manoj Kengudelu
Nov 14 '18 at 12:50
sorry manoj that is not what i required anyways thanks for the help
– balraj dacha
Nov 15 '18 at 9:10