how to change method description dynamically

classic Classic list List threaded Threaded
2 messages Options
SPS
Reply | Threaded
Open this post in threaded view
|

how to change method description dynamically

SPS
I want to collect method description for reporting purpose.Can I get some help please?

TestClass A {

private String manualScriptName = "ABC"


@Test ABC( description ="test1"){

    your code here.

   

}

@Test ABC( description ="test2"){

    your code here.

   

}

in my listener I would like to get description as "test1-ABC", "test2-abc"

how can I do that?



--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to change method description dynamically

Krishnan Mahadevan
Sneha,
Can you please help share a working example ?
The example you shared is not proper java code. So there's not much anyone can do here.

If you are looking at clubbing the method name and its description, then you should be able to get access to it via ITestNGMethod interface that is exposed in most of TestNG provided listeners.


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/

On Sun, Jul 10, 2016 at 6:19 PM, SPS <[hidden email]> wrote:
I want to collect method description for reporting purpose.Can I get some help please?

TestClass A {

private String manualScriptName = "ABC"


@Test ABC( description ="test1"){

    your code here.

   

}

@Test ABC( description ="test2"){

    your code here.

   

}

in my listener I would like to get description as "test1-ABC", "test2-abc"

how can I do that?



--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.