title: How to get a variable value from a test method with TestNG Listeners
body: <p>I'm using TestNG to run automation tests. I also implemented TestNG Listener to save the test results in a certain format.</p>
  
  <p>For some specific scenario I need to do the following:
  When a test runs, a value is assigned to a variable (local method variable).
  I need to pass the value of the variable to the TestNG Listener class I implemented. There are various methods (ontestStart, onTestFinish, onTestSuccess/Failure/Skipped), but I cannot figure out how to get the variable at run time.
  And I didn't find it in TestNG documentation.</p>
  
  <p>Can anyone please help? Or share his/her experience with a similar issue.</p>
  
  <p>Thanks!</p>