Can the configfailurepolicy be set programmatically?

491 views
Skip to first unread message

Javier Velasquez

unread,
Jul 10, 2014, 1:45:47 PM7/10/14
to testng...@googlegroups.com
Hi all,

Can the configfailurepolicy be set programmatically?

--
Javier

SUBRAMANYESWARA RAO BHAVIRISETTY

unread,
Jul 10, 2014, 2:32:04 PM7/10/14
to testng-users
Yes

http://testng.org/javadoc/org/testng/TestNG.html. It's avaialble in TestNG class.

setConfigFailurePolicy(java.lang.String failurePolicy)
          Sets the policy for whether or not to ever invoke a configuration method again after it has failed once.


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.



--
Subramanyam

Javier Velasquez

unread,
Jul 10, 2014, 6:37:33 PM7/10/14
to testng...@googlegroups.com
Can this be set with an already existing instance of TestNG and not a custom Suite Runner?

--
nycjv321

SUBRAMANYESWARA RAO BHAVIRISETTY

unread,
Jul 10, 2014, 9:24:18 PM7/10/14
to testng-users
I think you should use existing instance of testng.

Javier Velasquez

unread,
Jul 11, 2014, 9:42:57 AM7/11/14
to testng...@googlegroups.com
Would you mind providing documentation for using it against an existing instance of TestNG? E.g. Eclipse Test Runner, or Jenkins/Maven CI.

--
nycjv321

Krishnan Mahadevan

unread,
Jul 11, 2014, 10:02:36 AM7/11/14
to testng...@googlegroups.com
Javier,

If you are looking to do this via the TestNG suite xml file, just add configfailurepolicy="continue" to your suite xml file.

Valid values are "skip" and "continue". Default value for this attribute is "skip".

Refer here to know more : http://testng.org/testng-1.0.dtd.php

Sample

<suite thread-count="100" verbose="1" name="Basic Unit Test Suite" skipfailedinvocationcounts="false" junit="false"

    parallel="methods" data-provider-thread-count="50" annotations="JDK" configfailurepolicy="continue">


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

SUBRAMANYESWARA RAO BHAVIRISETTY

unread,
Jul 11, 2014, 1:02:31 PM7/11/14
to testng-users
Agree with Krishnan. It probably will be the right way to use it.

~Subramanyam
Reply all
Reply to author
Forward
0 new messages