Hello All,

Have a challenging question. Before that I would like explain what I doing
in my framework a bit:

1) I have created a custom annotation like this :
@Test()
@SolarWindsTest(testCaseID = "web-403")
public void doRegistration() throws Exception {
// code the test case here
}

2) In my testNG listener, in the OnFinish(ISuite iSuite), I am reading the
attribute value for "testCaseID" and using to generate a custom XML report.


3) In case of using the DataProvider feature in testNG, a single test
method will be run multiple times according to the set of data that has be
passed.


My question is: How to implement the above #1 into item #3 scenario ? I
want to assign a single testCaseID for each of the test data for which the
test method runs. I researched for dynamic annotation from this
page http://ayoubelabbassi.blogspot.in/2011/01/how-to-add-annotations-at-runtime-to.html
and seems a heck of implementation and wondering whether there is any
simple implementation to achieve this.

Experts, please chip-in :-)

Thanks,
Krishna Raj



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/9dixRPPGxW0J.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Krishnan Mahadevan at Dec 7, 2012 at 12:52 pm
    Krish,

    Have you explored @Factory in TestNG ?

    That should sort this out. A factory can be coupled with a data provider
    wherein each test class instance would basically represent one iteration to
    be done.

    P.S:
    You stand a better chance of getting more options, if you were to post this
    query on the testng-users forum.

    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/

    On Fri, Dec 7, 2012 at 4:54 PM, Krishna Raj S wrote:

    Hello All,

    Have a challenging question. Before that I would like explain what I doing
    in my framework a bit:

    1) I have created a custom annotation like this :
    @Test()
    @SolarWindsTest(testCaseID = "web-403")
    public void doRegistration() throws Exception {
    // code the test case here
    }

    2) In my testNG listener, in the OnFinish(ISuite iSuite), I am reading the
    attribute value for "testCaseID" and using to generate a custom XML report.


    3) In case of using the DataProvider feature in testNG, a single test
    method will be run multiple times according to the set of data that has be
    passed.


    My question is: How to implement the above #1 into item #3 scenario ? I
    want to assign a single testCaseID for each of the test data for which the
    test method runs. I researched for dynamic annotation from this page
    http://ayoubelabbassi.blogspot.in/2011/01/how-to-add-annotations-at-runtime-to.htmland seems a heck of implementation and wondering whether there is any
    simple implementation to achieve this.

    Experts, please chip-in :-)

    Thanks,
    Krishna Raj



    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/9dixRPPGxW0J.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedDec 7, '12 at 12:49p
activeDec 7, '12 at 12:52p
posts2
users2
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase