ITestContext

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

ITestContext

praveen133t
Hi,

Let's say I have a test and that test has a screenshot listener.

In the test I'm setting up something like below

public void setup(ITestContext context) {
context.setAttribute("extemp", "teststring");
}


Now I want to get the value of "extemp" from context in my screenshot listener. My screenshot listener has only onTestFailure(ITestResult testResult)  method.

Thanks!

--
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 http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: ITestContext

Shawn McCarthy-2
Try this:
testResult.getTestContext().getAttribute("extemp");


On Thursday, August 29, 2013 11:01:59 AM UTC-7, talon wrote:
Hi,

Let's say I have a test and that test has a screenshot listener.

In the test I'm setting up something like below

public void setup(ITestContext context) {
context.setAttribute("extemp", "teststring");
}


Now I want to get the value of "extemp" from context in my screenshot listener. My screenshot listener has only onTestFailure(ITestResult testResult)  method.

Thanks!

--
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 http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.