Hello Folks,
TestNG provides a beautiful functionality to parameterized our configuration and test methods so that we can execute the same test script with different set of data. To make a method (Configuration and Test) parameterized , we use “Parameters” annotation. If we make a method parameterized, we must need to pass parameters values from somewhere. TestNG provides below ways to do the same:
We have seen a lot of examples on “Parameters from testng.xml” already. You can go through them here:
TestNG Tutorials 42: Parameters In TestNG or Parameterization of Methods in a TestNG Class
TestNG Tutorials 43: Difference Between “Parameters” and “parameter” in TestNG
TestNG Tutorials 45: Passing Parameters at Test Method Level in TestNG
TestNG Tutorials 46: Overriding Parameters in TestNG
TestNG Tutorials 47: Marking a Parameter as Optional in TestNG
Now question comes here that:
Both they ways of providing parameters values in TestNG have their own advantages. We will compare them here:
I think now you can understand actual usage of DataProvider. We will see a lot about DataProvider in upcoming posts.
More about TestNG in upcoming posts. Stay tuned.
If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappySelenium
My name is Amod Mahajan and I am an IT employee with 4+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went throw so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning
Hello Folks, In last post, we have seen Why do we need to use DataProvider in TestNG. Now we will…
Hello Folks, As part of our API Testing series, we will see "Difference between REST and RESTFul API" in this…
Hello Folks, As part of our API Testing series, we will see below topics in this post: What is REST? Six…
Hello Folks, As part of our API Testing series, we will see some important HTTP status codes in this post.…
Hello Folks, Most of us know that, we can pass parameter as a String to methods in TestNG class. Is…
Hello Folks, You might see below dialog box when you download any file in Chrome browser and it finds that…