In this session, we would be looking into how we can
perform the data-driven tests while doing API Testing using Rest assured.
As we all understand data-driven testing is an integral
and important part while designing any testing framework as it helps us to segregate
our test data from the code.
So whenever any change happens in the data we don’t need to go and update that in code instead, we can update test data in our the source where we have kept it (Test Data can be kept either in excel or in some configuration or class files inside our project).
So whenever any change happens in the data we don’t need to go and update that in code instead, we can update test data in our the source where we have kept it (Test Data can be kept either in excel or in some configuration or class files inside our project).
So In this session, we would be continuing doing some data
driven test with One Sample API that we already have worked in our previous
session.
As you have observed in my last blog we have done the
hard coding of our Base URI and also every time when doing post requests we are taking the body from our code which is not good practice and should be avoided. Below is the code snapshot from my last blog.
In this session, we would be looking into two approaches
of doing the Data-Driven Test while doing API Testing
รผ Using
Properties or Configuration file
รผ Using
Class File
Approach 1:
For Reading test data from Properties or configuration the file we can perform below steps
For Reading test data from Properties or configuration the file we can perform below steps
1) Inside
project main Folder under Configuration or any other Package of your choice create
one text file with extension as .properties in this example I am creating one file named as Config.properties
2) In these properties, the file declares the value in Key, value format of our Base URI.
3) In
project Base Class or in same test Class, declare one Properties variable and provide the path of
.properties file along with below code snapshot.
4) Now
we are ready to use our Properties file inside test classes using below syntax.
pro.getProperty("BaseUrl");
Here, the getProperty method will take the Key of
the property as a parameter and return the value of the matched key
from the .properties file.
Approach 2:
Similarly for reading data from Another Class file we could follow the below steps:
Similarly for reading data from Another Class file we could follow the below steps:
1) Inside
project main Folder under Resources or any other Package of your choice create
one class file let’s say TestResources.java
2) In
this Class create one static function and declare the body which we want to put
in request and return that string.
3) Finally
Call this function inside our test class using
classname.function name
The final Code for the API would look like below. If we observed carefully this code is much cleaner and easy to maintain than my last code.
The final Code for the API would look like below. If we observed carefully this code is much cleaner and easy to maintain than my last code.
Who approaches? Who claims it (don't make a presumption here))? By what means will it be conveyed back so you can move it to a contender's foundation?ExcelR Data Science Courses
ReplySuch a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
Reply360DigiTMG artificial intelligence course in hyderabad
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
ReplyData Science Course
This post is very simple to read and appreciate without leaving any details out. Great work!
ReplyData Science Certification in Bangalore
Admiring the time and effort you put into your blog and detailed information you offer!..
ReplyData Science Course in Bangalore
I would like to say that this blog really convinced me to do it! Thanks, very good post.
ReplyData Science Training in Bangalore
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyCorrelation vs Covariance
Simple linear regression
Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject. free instagram likes instantly without password
ReplySuch a very useful article. Very interesting to read this article. I would like to thank you for the efforts you had made for writing this awesome article.
ReplyData Science Course in Pune
Data Science Training in Pune
Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
ReplyData Science Institute in Bangalore
Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.
ReplyData Science In Banglore With Placements
Data Science Course In Bangalore
Data Science Training In Bangalore
Best Data Science Courses In Bangalore
Data Science Institute In Bangalore
Thank you..
I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
ReplyData Science Certification in Bangalore
If it's not too much trouble share more like that.
ReplyData Science Course in Bangalore
You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your blog.
ReplyData Science Training in Bangalore
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck. data science training in coimbatore
ReplyReally nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
Replydata science interview questions
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
Replydata science interview questions
ReplyThis post is great. I reallly admire your post. Your post was awesome.
data science course in Hyderabad
I feel a lot more people need to read this, very good info!.Learn best Data Science Course in Hyderabad
ReplyReally nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.Learn best Business Analytics Course in Hyderabad
ReplyI feel really happy to have seen your post and look forward to so many more interesting post reading here. Thanks once more for all the details.Learn Best Data Science Training in Hyderabad
ReplyVery interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyCorrelation vs Covariance
Simple linear regression
data science interview questions
Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important. Project Center in Chennai It’s what organizations do with the data that matters. Big data can be analyzed for insights that lead to better decisions and strategic business moves.
ReplySpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Very impressive and interesting blog found to be well written in a simple manner that everyone will understand and gain the enough knowledge from your blog being more informative is an added advantage for the users who are going through it. Once again nice blog keep it up.
Reply360DigiTMG Data Analytics Course
Very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data science course in hyderabad with placements
ReplyI am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplySimple Linear Regression
Correlation vs Covariance
Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.
Reply360DigiTMG Business Analytics Course
Terrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. In fact, educating the participants with it's amazing content. Hope you share the similar content consecutively.
Reply360DigiTMG Data Analytics Course
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplySimple Linear Regression
Correlation vs Covariance
This is actually the data I'm searching for, I was unable to have requested a less difficult perused with extraordinary tips this way... Much appreciated!
Replydata science course in delhi
Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplySimple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained
Excellent post. I learned a lot from this blog and I suggest my friends to visit your blog to learn new concept about technology.Best data science courses in hyerabad
ReplyAttend The Data Science Courses From ExcelR. Practical Data Science Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Courses.
ReplyData Science Courses
I found hubwit as a transparent site, a social hub which is a conglomerate of Buyers and Sellers who are ready to offer online digital consultancy at decent cost.
ReplyBest Institute for Data Science in Hyderabad
Glad to chat your blog, I seem to be forward to more reliable articles and I think we all wish to thank so many good articles, blog to share with us.
Replydata science course in Hyderabad
Set aside my effort to peruse all the remarks, however I truly delighted in the article. It's consistently pleasant when you can not exclusively be educated, yet in addition, engaged!
Replyhttps://360digitmg.com/masters-in-full-stack-data-scientist-course/
Very great post. I just discovered your blog and needed to state that I have truly appreciated perusing your blog entries. Any way I'll be buying in to your feed and I trust you post again soon.
Replydata scientist course
Thanks for sharing great information. I highly recommend you.data science courses
ReplyThanks for sharing the valuable information. it’s really helpful.Best data science courses in hyerabad
ReplyI have to search sites with relevant information ,This is a
Replywonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Course in Bangalore
I've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!
Replydata science courses
I recently found a lot of useful information on your website, especially on this blog page. Among the many comments on your articles. Thanks for sharing.
ReplyBusiness Analytics Course in Bangalore
Hello! I just want to give a big thank you for the great information you have here in this post. I will probably come back to your blog soon for more information!
ReplyData Analytics Course in Bangalore
Your blog is so impressive to us. I appreciate the way of delivering the concepts.
Replyadvantages of ai
what is net core
features of hadoop
hadoop framework
list of devops tools
selenium interview questions with answers
I have to search sites with relevant information ,This is a
Replywonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Training in Bangalore
Amazing journal. I appreciated studying your articles. this can be extremely a fantastic perused on behalf of me. I even have bookmarked it and that i am anticipating studying new articles. Keep doing awesome!
Replydata scientist certification
You have done an excellent report on the knowledge that you have shared in this blog.
Replydata analytics course
I recently came across your article and read it. I want to express my admiration for your writing skills and your ability to get readers to read from start to finish. I would love to read more recent articles and share my thoughts with you.
ReplyData Science Course in Pune
Honestly speaking this blog is absolutely amazing in learning the subject that is building up the knowledge of every individual and enlarging to develop the skills which can be applied in to practical one. Finally, thanking the blogger to launch more further too.
ReplyData Analytics online course
This Blog is very useful and informative.
Replydata science in malaysia
Thanks for your nice post I really like it and appreciate it. My work is about Custom Vape Cartridge Boxes. If you need perfect quality boxes then you can visit our website.
ReplyThanks for posting the best information and the blog is very helpful.data science interview questions and answers
ReplyVery awesome!!! When I searched for this I found this website at the top of all blogs in search engines.
Replybusiness analytics course
I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
Replyartificial intelligence course in pune
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replydata analytics courses in bangalore
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replydata science course in chennai
You have completed certain reliable points there. I did some research on the subject and found that almost everyone will agree with your blog.
ReplyData Science Training in Bangalore
Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such amazing content for all the curious readers who are very keen on being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in the future too.
ReplyDigital Marketing Training in Bangalore
I wanted to leave a little comment to support you and wish you the best of luck. We wish you the best of luck in all of your blogging endeavors.
ReplyArtificial Intelligence Training in Bangalore
The Extraordinary blog went amazed by the content that they have developed in a very descriptive manner. This type of content surely ensures the participants explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.
ReplyMachine Learning Course in Bangalore
Great to become visiting your weblog once more, it has been a very long time for me. Pleasantly this article i've been sat tight for such a long time. I will require this post to add up to my task in the school, and it has identical subject along with your review. Much appreciated, great offer. data science course in nagpur
Replyi am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
Replyartificial intelligence training in chennai
I truly appreciate just perusing the entirety of your weblogs. Just needed to educate you that you have individuals like me who value your work. Unquestionably an extraordinary post. Caps off to you! The data that you have given is exceptionally useful.data science training in chennai
ReplyI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replybusiness analytics courses
Extraordinary blog went amazed with the content that they have developed in a very descriptive manner. This type of content surely ensures the participants to explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.
ReplyData Science Training
Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.
ReplyData Science Certification in Bhilai
This is additionally a generally excellent post which I truly delighted in perusing. It isn't each day that I have the likelihood to see something like this..
ReplyI am searching for and I love to post a remark that "The substance of your post is wonderful" Great work! data science course in chennai
Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. python course in delhi
ReplyI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replydata science course
Nice to be visiting your blog once more, it has been months for me. Well this article that i've been waiting for therefore long. I want this article to finish my assignment within the faculty, and it has the same topic together with your article. Thanks, nice share.
Replydata scientist course in hyderabad
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replyaws training in hyderabad
Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. data scientist course in delhi
ReplyI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replyiot training in hyderabad
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors.
Replyiot course in bangalore
You have completed certain reliable points there. I did some research on the subject and found that almost everyone will agree with your blog.
ReplyArtificial Intelligence Training in Bangalore
It is late to find this act. At least one should be familiar with the fact that such events exist. I agree with your blog and will come back to inspect it further in the future, so keep your performance going.
ReplyDigital Marketing Training in Bangalore
A good blog always contains new and exciting information and as I read it I felt that this blog really has all of these qualities that make a blog.
ReplyData Science Training in Bangalore
Happy to chat on your blog, I feel like I can't wait to read more reliable posts and think we all want to thank many blog posts to share with us.
ReplyMachine Learning Course in Bangalore
I am glad to discover this page. I have to thank you for the time I spent on this especially great reading !! I really liked each part and also bookmarked you for new information on your site.
ReplyData Science Course in Delhi
I wanted to leave a little comment to support you and wish you the best of luck. We wish you the best of luck in all of your blogging endeavors.
ReplyData Science Training in Bangalore
Really impressed! Everything is a very open and very clear clarification of the issues. It contains true facts. Your website is very valuable. Thanks for sharing.
ReplyDigital Marketing Training in Bangalore
A good blog always contains new and exciting information, and reading it I feel like this blog really has all of these qualities that make it a blog.
ReplyArtificial Intelligence Training in Bangalore
I am more curious to take an interest in some of them. I hope you will provide more information on these topics in your next articles.
ReplyMachine Learning Course in Bangalore
This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog..
Replydata scientist course in malaysia
i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
Replydata engineering course in india
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.cloud computing course in lucknow
ReplyI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replyai courses delhi
Informative blog
Replycloud computing training institute in kolkata
Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. data science course in lucknow
ReplyInformative blog
Replydata analytics courses in ahmedabad
Amazingly by and large very interesting post. I was looking for such an information and thoroughly enjoyed examining this one. Keep posting. An obligation of appreciation is all together for sharing.data science training in bangalore
ReplyNice article with valuable information. Thanks for sharing.
ReplyAWS Training in Chennai | AWS Training institute in Chennai
Glad to chat your blog, I seem to be forward to more reliable articles and I think we all wish to thank so many good articles, blog to share with us.
Replydata science training
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replydata analytics training in gurgaon
Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.
ReplyData Science Certification in Bhilai
This blog was really great, never seen a great blog like this before. i think im gonna share this to my friends..
Replydata science training in hyderabad
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replybusiness analytics course in varanasi
It's a smart blog. I mean it seriously. You have so much knowledge on this subject and so much passion. He also knows how to get people to join him, obviously from the answers.
ReplyData Analytics Course in Nagpur
This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post. Data Science Course in Vadodara
ReplyTruly overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. Much obliged for sharing.data analytics courses in bhopal
ReplySuperbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. data analytics course in mysore
ReplyI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replydata analytics course in varanasi
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replydata science training in delhi
This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post. Data Science Course in Chennai
ReplyA great website with interesting and unique material what else would you need.
Replycyber security course malaysia
Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.
ReplyData Science Training in Bhilai
This post is very simple to read and appreciate without leaving any details out. Great work!
Replydata science coaching in hyderabad
Truly overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. Much obliged for sharing.data science course in bhopal
ReplyExtremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one.
ReplyContinue posting. A debt of gratitude is in order for sharing.
business analytics course in warangal
Writing with style and getting good compliments on the article is quite hard, to be honest.But you've done it so calmly and with so cool feeling and you've nailed the job. This article is possessed with style and I am giving good compliment. Best! diploma in digital marketing malaysia
ReplyIt is the perfect time to make some plans for the future and it is the time to be happy. I've read this post and if I could I would like to suggest some interesting things or suggestions. Perhaps you could write the next articles referring to this article. I want to read more things about it!
Replydata analytics course in hyderabad
I am impressed by the information that you have on this blog. It shows how well you understand this subject. data analytics certification malaysia
ReplyExtremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one.
ReplyContinue posting. A debt of gratitude is in order for sharing.data science course in warangal
Informative blog
Replybusiness analytics course in agra
pleasant blog! its fascinating. much obliged to you for sharing Business Analytics Course in Dehradun
ReplyI want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replydata science course in faridabad
I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
Replydata scientist course in trivandrum
Unquestionably generally speaking very intriguing post. I was looking for such an information and totally savored the experience of examining this one. Keep on posting. A responsibility of appreciation is all together for sharing.business analytics course in bhubaneswar
ReplyTook me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! data analytics courses malaysia
ReplyEverything is very open with a clear clarification of the issues. It was truly informative. Your site is useful. Thank you for sharing!|data analytics course in jodhpur
ReplyGreat Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot.
Replybusiness analytics training in hyderabad
Through this post, I know that your good knowledge in playing with all the pieces was very helpful. I notify that this is the first place where I find issues I've been searching for. You have a clever yet attractive way of writing. digital marketing training malaysia
ReplyAmazingly by and large very interesting post. I was looking for such an information and thoroughly enjoyed examining this one. Keep posting.
ReplyAn obligation of appreciation is all together for sharing.data analytics course in gwalior
Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. Data Scientist Course in Dehradun
ReplyI have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site. data analytics courses malaysia
ReplyWow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also. Project Management Course
ReplyWow, what great information on World Day, your exceptionally nice educational article. a debt of gratitude is owed for the position.
Replydata science training
Gangaur Realtech is a professionally managed organisation specializing in real estate services where integrated services are provided by professionals to its clients seeking increased value by owning, occupying or investing in real estate. data science classes in pune
ReplyThis is an awesome motivational article. I am practically satisfied with your excellent work. You put really extremely useful data. Keep it up like this. Keep blogging. Looking forward to reading your next post
ReplyData science course in mangalore
The data scientists work on the raw data to take the right insights from it for making better decisions to make the business more prosperous.
Replydata science training in patna
Data Science is a dynamic domain with a promising future, start your Data Science Course today with 360DigiTMG and become a Data Scientist without hassle.business analytics course in nashik
Reply