pass parameters to TestNG test methods?

Modified on Tue, 28 Mar, 2023 at 4:31 PM

To pass parameters to TestNG test methods, you can use the “@Parameters” annotation along with the “@Test” annotation. Define the parameter values in a separate XML file, and pass the values as an array to the test method. 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article