Why not make use of ISuite for sharing data between <test> ?
At any point in time from within a @Test method, you can do something like this:
org.testng.ISuite suite = Reporter.getCurrentTestResult().getTestContext().getSuite();
//To set an attribute use
//To read a set attribute use
Thanks & Regards
"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/
From: <[hidden email]> on behalf of Anurag Gupta <[hidden email]>Reply-To: <[hidden email]>Date: Wednesday, August 9, 2017 at 3:34 PMTo: testng-users <[hidden email]>Subject: [testng-users] Pass Argument across <test> Tag in tesNG
I am stuck to pass parameter obtained in one test to other . ItestContext only passes if it is in the same tag within testng.xml . For example.
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<test name="Test For Demo">
<test name="Test For Demo2">
By ITestContext we can only pass value from testUtility.TestClass to testUtility.TestClass1 , but cannot pass from testUtility.TestClass to testUtility.TestClass2 . Is there any method to do so ?
-- 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.