42. Share Data From One API To Another API In Rest Assured
Vložit
- čas přidán 22. 08. 2024
- Hey Guys,
Sharing data among test methods and classes is a major part of test automation. Data generated by an API may be used for other APIs. For example - Created booking id needs to be used by update, delete booking APIs.
We will see pure Java ways to share data among tests. The same can be used for Selenium or any other test automation framework.
GIT Repo - bitbucket.org/...
If you do not like my content please share your feedback so that I can improve myself.
If you like my content then please like, subscribe, and share.
Thanks
Amod
"tools may outdated, but the core programming language is always the same, so be good at the language" --> this is 100 percent true.
Amod, Also much impressed when you say the declaration of Constructor so that no one create objects and also when you create interface, you said it is Public, static and final - You are clearly mentioning the properties of each concepts and the advantages too. Well done and Please continue this momentum with indepth concepts of Java. Thanks !
You explain the topic in a very easy way. Thanks for all the hard work and for helping the testing community.
Awesome training, Amod - Tons of Thanks to You. I have impressed your training only because you have driven this course through Java concepts which will be there till this world is Alive !
Tools will not sustain for long term. Thank You again !
You're the best in restassurd 👏👏
Awesome Amod. Data store as Map I learned today. Thanks a lot.
Glad to hear that
Tq for the video
Hi Amod,
In your future video will u cover API automation framework?
Yes, definitely
Hi Amod,
Could you please create end to end framework using Restassured.
Hi Amod, these approaches are cool & loved them specially the 4th one.
I have a doubt regarding limitation of 3rd approach, DataStore class - here we are storing all the common data that we want to share across other classes.
//My understanding on limitation of 3rd approach is,//
For the DATA to be SHARED across other classes, FIRST we need to CREATE the VARIABLES & store the DATA. then only we can use them in other classes. Right?
This means, that there is a dependency on creation of variables first in order to share the data to other classes? Right Amod?
int id =(int) DataStoreMap.getValue("bookingid"); --- got class cost exception
worked with below :
Object id = DataStoreMap.getValue("bookingid");
Check the type of bookingid you are using to store value. Casting to Object is not solution.
Sir,
Excellent teaching ...please can you uploads on basic auth, auth 0.1 and auth 2.0
Everything will be covered.
Subscribed
Hi, thank you for your detailed explaination. Can we use config.properties file instead of DataStore class? Would that be good practice or would it become messy?
You can use but Reading and writing in properties file will be headache. You can also use Map so store any value.
Declaring booking id as static will not create any problem when you run in parallel ?
what if an object or list of arrays comes in response? how can I store and access in next API calls?
It's not a good idea to have dependency across tests. What if test#1 failed or was removed or smth?
Yes it is not good practice of not creating dependent tests but if we create we need to have some handling of negative scenarios in dependent tests.
Will it be more memory efficient to use datastore as a singleton instead of using it as a static class?
I am restricting creation of object of that data store class. You can use the same thing using singleton class as well.
need help with multiple auth
But how to pass first name , could you please explain that one also
Can you elaborate ur question?