Free YouTube Transcribe

Video transcript

Complete API Automation Framework-Rest Assured #sdet #automationtesting

Tech with Jatin · 47,398 words · 216 min read

Want to search this transcript, jump the video from any line, or download it as TXT, SRT, or VTT?

Open in the transcript tool

Full transcript

0:00hey friends how's it going so in today's

0:02video we will be building a complete API

0:05test automation framework from scratch

0:08now if you haven't met yet hi my name is

0:11jutan and I'm a principal QA with 10

0:13plus years of experience in automation

0:15testing and devops now this video comes

0:18from my main course the live sessions

0:21which I take for the sad Mastery Program

0:24where I help students and professionals

0:26transform their career from manual to

0:28automation testing now in this

0:31particular video you will learn how to

0:33create an API test automation framework

0:36from scratch you will also learn how to

0:39use the rest assured library in your

0:42automation framework okay next we will

0:45learn the different design patterns that

0:48you need to know while you create your

0:51API test automation framework along with

0:53that we will learn how to write clean

0:56and maintainable test scripts in your

0:59frame work now throughout this entire

1:03video I will be discussing the common

1:05challenges students and professionals

1:07face while creating the framework okay

1:11now the beauty of this particular video

1:13guys is that I will be building the

1:16entire framework in front of you guys so

1:18you will be seeing the live coding

1:20happening okay throughout the entire

1:23video you will also hear the discussions

1:26the doubts that I'm having with students

1:28so probably probably these questions

1:30will be something that you might also

1:32think so you will get the direct Clarity

1:35on why certain topics are used for your

1:37convenience I have created the notes for

1:40this entire course and you will find it

1:42in the description section for this

1:44video now without wasting time guys

1:47let's get started okay and this is

1:50actually um a kind of a group session

1:52that I decided so I was not having any

1:54class in the weekend for today and uh

1:58people from other batches have also

2:00joined uh anyways so the main thing um

2:04over here guys is um it's going to be a

2:06quick recap for everyone and uh the most

2:10important thing is for the next two days

2:12that is today and tomorrow we will be

2:14building an API automation framework

2:17okay I believe um it's um you have Sol

2:20the Tet interview question which is

2:22there on the LMS okay um that particular

2:27assignment um would be the backbone okay

2:30if you haven't solved it I would suggest

2:32you this is like the month of December

2:35so please make sure that you try to

2:36complete it off this month itself so you

2:39are aware of your entire API as well as

2:41your UI automation

2:43framework most of the around 30 40% uh

2:47things will be similar for that would

2:50you what would you have seen it in the

2:51Tet interview cion rest of the stuff

2:54I'll be introducing it in today's class

2:57uh so what I've done um over here guys

3:01is for your

3:04convenience uh just give me one moment

3:06let me uh select that page

3:23yeah let me know if my screen is visible

3:26yeah I hope you guys are able to see the

3:28screen right now

3:30yep okay perfect okay what I've done for

3:33your convenience guys I've given it a

3:34more like a stepbystep guide for you

3:36guys to practice it off especially for

3:39people who have just started and they

3:40really don't know what exactly is apis

3:42and all those things but I don't think

3:45there is going to be any person who is

3:47not aware of apis so um over here it is

3:52going to be a little bit different a lot

3:54of things um I won't be discussing uh in

3:58this particular class what we will be

3:59discussing and what will be the major

4:01premise of this particular class I'll

4:02just first talk about that the major

4:05focus is only going to be on building

4:07the API automation framework okay so the

4:11first thing and the only thing that I

4:13want to focus on is building the

4:15framework okay that's the only thing

4:18this uh two days is going to be focusing

4:21on um I want to but I can't really go

4:25into discussing the various type of

4:27authorization and all those things so

4:29you will be finding those things in the

4:31LMS in future right now that's not

4:33something really important because if

4:35you're giving interview also they'll

4:36probably ask you what is the

4:38authorization technique used in your

4:40project how did you uh pass the

4:43authorization token how did you write

4:45the test in apis so and so forth so this

4:48is going to be more from the Practical

4:50implementation perspective rather than

4:53conceptual perspective though I will try

4:56to discuss those things as much as I can

4:59but you know like we have a timeline so

5:01we need to complete it in 2 days the

5:04next thing that comes over here guys is

5:07uh um this is the entire documentation

5:10probably it would be a great idea for

5:11you guys that you download it off uh

5:14take a print out of it and when you are

5:15practicing it you know like you have

5:17some some kind of a reference for you

5:19guys okay so you can use it for your

5:21reference I broken it down into scripts

5:23so whenever I will be coming and writing

5:26code I'll just try to use this as a

5:28reference okay not 90% of the time I'll

5:30probably write it by myself over there

5:32but for you guys I have given this

5:34particular notes so that you understand

5:36how exactly the framework needs to be

5:38created okay uh for your convenience um

5:43the different design patterns uh that

5:46will come into picture how exactly

5:48service object model will be different

5:49from page object model okay I'll come to

5:52this particular page probably tomorrow

5:53okay but not something really need to be

5:55worried about so the end to endend

5:58structure of this particular framework I

5:59have created it off how exactly logger

6:01needs to be created um logger will be

6:04more or less similar that what you have

6:06seen it in the tell it okay the only

6:10thing is what are filters and rest

6:11assured that's something that I'll

6:12probably discuss it off in tomorrow's

6:14class it's for day two so technically

6:16nothing to worry on all those things

6:18okay

6:19now um when you guys probably I'm

6:23talking about the everyone over here

6:25like when you saw the old application

6:26was Phoenix application most of you guys

6:28would be I'm I still see you guys test

6:30that particular application so I know

6:32that part but uh over the period of time

6:35like uh there were a couple of new

6:36applications that I was building I was

6:38trying to learn different things so I

6:40created uh a separate application itself

6:42now which um is uh Swift actually okay

6:46so it's it's a kind of a different

6:48application um which gives more or less

6:51more scenarios compared to that of your

6:55Phoenix Phoenix was simple cred

6:57application of course this is also cred

6:59application

7:00but um over there the number of apis I

7:02try to increase it off the number of

7:04scenarios number of challenges that you

7:07face in your uh API testing I try to add

7:10it off overo okay so for you guys uh you

7:14can use this particular application

7:16which is uh swift. um something like

7:20swift. Tech Jan you can just visit this

7:22particular website and uh just for the

7:25folks who are not aware of this

7:26particular stuff it's just a simple

7:28banking application okay trying to

7:30depict a banking application but the way

7:32it is created is um it has only bugs

7:36okay you will never find anything okay

7:40such uh like something which works but

7:42still doesn't work over here and the

7:44reason for that is uh instead of giving

7:47you an application which is already

7:49working properly and I then tell you

7:51guys to test it off that doesn't make

7:52sense right because then you won't be

7:55able to understand why why are we

7:57testing something so I thought we'll do

7:59the reverse stuff we created the

8:01application then we introduced the bugs

8:03now for your convenience what needs to

8:05be tested how it needs to be tested I

8:07have already created these um scenarios

8:10for you if I'm not wrong these are all

8:12your API testing scenarios okay so check

8:17whether the user is able to register

8:19check whether uh existing uh user is um

8:23registration with existing username is

8:25happening or not so it should fail so

8:27whether it's a positive scenario or

8:29negative scenario I've covered it off so

8:31when you guys are practicing it also

8:33what needs to be tested how it what all

8:35scenarios are there these things are

8:37written over here so you can take it as

8:39a reference and practice it off okay

8:42it's just going to help you guys speed

8:43up your entire testing part over here uh

8:47as of for today I will be using this

8:49particular stuff itself so the entire

8:51API documentation of your Swift

8:54application is this Swagger do which is

8:57this new server which is there I'll

8:59probably put it inside um um this

9:03documentation itself so that uh you know

9:05like even if you want to use it off

9:08you'll find it at one

9:13place I hope this part is clear to

9:15everyone okay just for you guys I'll

9:17comment it off also uh where is this PDF

9:20uh it's not a PDF uh it's a web page

9:23buddy

9:26so okay um see if you are able to open

9:30this particular

9:31documentation for UI and API both as in

9:34I did not get that particular question

9:38what exactly that means let me just see

9:41that

9:42part where is this PDF UI and API both

9:46as

9:47in I didn't catch that particular

9:50question anyways so let's get started

9:53over here now uh the thing is let's try

9:57to do it in a bit different way

10:01okay

10:03uh let

10:05me share the

10:17Whiteboard I hope you guys are able to

10:19see my screen right

10:21now mhm okay perfect so this is the API

10:26automation framework that we need to

10:28create

10:30now let's

10:32say that in interview they ask you about

10:35the framework that you have created okay

10:37particularly from apis

10:40okay generally whenever you're creating

10:43the framework um for your application

10:46it's always better that you say that you

10:47have created one framework which is able

10:50to do multiple things okay because then

10:53you have only one Center Point to look

10:56at now over here let's let's say that

11:00you have created an API automation

11:02framework so the first thing that comes

11:04into picture is which libraries are you

11:05going to use so the library that we have

11:08used is of course rest

11:10assured okay plus test

11:14AG we'll come to this particular

11:16library now when you are trying to test

11:21an

11:22application okay a common question that

11:25can come into picture is how many apis

11:27you have tested how many apis you have

11:29tested over there so you can just say

11:31whatever the count which is there okay

11:34right now I've just increased it off to

11:35let's say 27 28 API whatever coming into

11:39picture but the point that comes into

11:41picture is how the framework is created

11:44how did you write your API test okay

11:47today the team actually released one

11:49lecture over there in the E uh in the

11:52LMS which is the epam interview question

11:55and the first question which is very

11:56commonly asked question is write the

11:57snippet for your rest a short script

12:01write the snippet for your rest a short

12:03script so generally whenever people try

12:07to take interviews they will see if

12:08you're able to write the API scripts or

12:11not that's the first thing like how

12:13exactly you'll be using your rest

12:14assured

12:16library now whenever we are testing any

12:21application the first thing that the

12:23developer would be giving it giving to

12:26us is this Swagger document okay

12:29creating this document is not a big

12:31thing it's something which is generated

12:33by the system itself but this document

12:35will be available and over here you see

12:38there are various sections account

12:41controller admin controller

12:44authentication kyc controller mock UI

12:47mock UPI controller report controller

12:50transaction user management

12:52controller these are basically what you

12:54call as service each tab over here is

12:57called as a service over here okay so

13:01let's say this becomes a

13:02service so in an application I have

13:05authentication as a

13:08service now when authentication as a

13:10service comes into picture there are

13:11multiple things that can happen with au

13:13authentication someone can login someone

13:16can create account someone can say that

13:19I forgot my password right so this tab

13:24which you see is my authentication

13:26Service section and if you're not able

13:28to remember remember that part just open

13:30any of these things you see this area

13:33API for/ API for/ this is basically your

13:39o authentication Service that's popping

13:42up what you see over

13:46here sign up reset password login and

13:49forgot password these becomes my end

13:51point now the thing that comes into

13:54picture is I have to test this

13:57particular end point yes or no that's

13:59the most simplest thing that comes over

14:01there now when you're talking about apis

14:05just for a quick

14:08revision data from UI will be given to

14:11API and API is going to give the data or

14:14is going to fire a query over the

14:17database and it's going to retrieve the

14:19data and it is going to give the data

14:21back to UI that's what the working of

14:24API is it's just it's like a mediator

14:27okay and generally what this mediator

14:30tries to does it it tries to create

14:32abstraction or it's trying to hide the

14:35direct access to database as simple as

14:37that the reason we have to do that part

14:40is because if you're trying to hide it

14:42off you know like illegal access to the

14:45database is not going to happen

14:47Okay

14:51dat operation perform

14:54dat right so that's the thing that comes

14:57into picture now now over here the thing

15:00is how do I come to know what data needs

15:04to be sent of course if there is going

15:06to be a Swagger documentation it becomes

15:08pretty easy where I can see these things

15:10happening over into picture that this is

15:11going to be the payload this is the

15:13response which will come into picture

15:15and I can cross check the same thing

15:16from here

15:17also let's

15:19say I say log out now I forgot the

15:23password just give me a moment what is

15:25the new password over here same yeah now

15:28over here

15:29this is the UI if I right click click on

15:33inspect go to the networks

15:36tab over here I will see all the API

15:39calls which are happening note that you

15:42have to be in Fetch for/ xhr tab you can

15:45be in all also but I am not interested

15:47in all operations like I don't want to

15:48see all the calls which are happening

15:50over the network I just want to see the

15:52API calls which are coming into picture

15:55so that's the reason I have written

15:56fetch for/ XR of mar those sign in so of

16:00course when I try to do sign in and the

16:02credentials is bad let me just cross

16:04check what can be the credentials over

16:07here is it right ah this is the right

16:10one okay I keep on forgetting the stuff

16:12anyways so over here even though the

16:16login has happened but uh let's go to

16:19all log

16:21out

16:23okay sign in

16:34it's not showing me just give me a

16:36moment update the

16:51password okay so here you can see the

16:53login API call which is coming into

16:55picture now you see the credentials over

16:58there which was written was if I go to

17:00the payload UD

17:021234 UD 12 34 that's the credentials

17:05which was there so the username and

17:08password is given from the UI to the

17:13API from the UI the user would have

17:16entered UD 1 2 3 4 UD 1 2 3 4 and the

17:19credentials would have been given to the

17:21API when API try to fire the data or

17:25fire the query let's say select star

17:28from data space where the username is

17:31going to be udai 123 4 and password is

17:33going to be 1 12 34 there would be a

17:36response coming some entry needs to be

17:38there so when I go to the response this

17:40is the response which is coming back and

17:43the journey over here is that I have to

17:45test whether the apis are working

17:47correctly or not as is this part clear

17:50to everyone yes or

17:52no okay so I know the payload and I know

17:56the response which is coming over here

17:57and this is something that I need to

17:59test okay now over here how to approach

18:02this particular

18:04stuff now we'll go step by step the

18:07first thing uh that what I want to do

18:09over here is let's say let's close all

18:12the tabs over here everything let's

18:14close and one moment yeah perfect let's

18:18create a new project itself I'm going to

18:20create a new project and I'm going to

18:22call this as a maven based project so

18:24the API automation framework that we

18:26have created is a maven based project

18:28and I'm going to call this particular

18:30project as uh demo API automation

18:35framework because I've already used a

18:36lot of words like API framework and all

18:41okay I'm going to copy this and I'm

18:44going to put it off over

18:52you now over here guys let's click on

18:56finish and where exactly comes yeah this

18:59is where the demo API automation

19:01framework comes into picture so this is

19:03my your API automation framework which

19:06is there now over here the first thing

19:09that I need to do is I need to make sure

19:11that I'm updating my Java versions

19:15better to go for Java 11 version Java 17

19:18version than to stick to 1.8 so I'm just

19:21going to go to build path configure

19:24build path and make sure you change the

19:27version from 1.8

19:29and just click on edit and change it to

19:32Java 11 okay Finish apply and close the

19:35change has

19:36happened next go to the pom.xml file and

19:39you have to introduce the

19:40dependencies what dependencies you're

19:42going to introduce rest assured and

19:44testng so if I go to your

19:49document just scroll to the first

19:51section of course you can go to the m

19:53repository and all I'm just trying to

19:55keep things simple for now uh if I just

19:58scroll

19:59down you're going to take these

20:02dependencies pal. examl dependencies

20:04copy it

20:05off and pasted it off over

20:08here nothing fancy stuff I have done

20:10over here so I have this rest assured

20:12and I have this test NG dependency which

20:14is there and over here the only focus

20:18right now for me the entire thing the

20:20entire purpose of my life is to just

20:22test this login API apart from that I

20:24don't want to focus on anything else

20:26that I have been given this API I have

20:28to make API request and rest assured and

20:30I have to assert whether the status code

20:33turns out to be 200 or not that's the

20:36ultimate purpose of my life that's all

20:38okay and along with that along with that

20:41probably I'll just check whether token

20:43and all those things gets generated

20:44something like that we can do those

20:46things now how do we do that part just a

20:49quick revision for rest ass short for

20:50people now whenever you writing test you

20:53will always be writing the test in sassc

20:55test Chava that's the whole purpose if

20:58you if you are going to write any

21:06test okay reason because ultimately you

21:10want to run your framework and you will

21:13be running your framework with the

21:14command what mavin test okay you will

21:18write something called uh mavin okay

21:21test and what Maven test is going to do

21:24is it's going to run whatever is there

21:25over here so Maven test compiles this

21:28particular package and whatever is there

21:31in this particular folder and it's going

21:32to execute it

21:34off test it's going to start executing

21:38all right that's that's the reason now

21:40over

21:41here the first thing that I want to do

21:43is I want to create a package so I'm

21:45going to create the first package of

21:47your automation framework you want to

21:48make a note of this particular package

21:50if you want com. api. test so all the

21:54test related to my application

21:57particularly my API t test will be

21:59available over here now what is the test

22:02that we want to focus on login API test

22:04so I'm going to quickly create a class

22:05let's call this particular class as

22:08login

22:11API

22:13test okay let's uh drop this thing off

22:18zoom in and what we do over here guys is

22:20we're going to create a test method

22:22please be on mute public void let's say

22:26this is going to be

22:30login test something like that now of

22:33course this is a test NG test so you're

22:37going to introduce the test NG

22:38annotation you know you have to give

22:40name and all those things okay just for

22:43your revision I'll put it off over here

22:45verify if login API is working something

22:49like that I put it off okay

22:53now sorry description my bad my bad okay

22:57now over

22:59here the story starts over here I want

23:02to test the API in order to test the API

23:06the library that comes into picture is

23:08rest assured I have added the dependency

23:10of rest assured into my application

23:13for.xml file this is where rest assured

23:15is now of

23:18course rest assured is a class it's a

23:22class so do I need to create an object

23:24of rest assured yes or no do I need to

23:28create an object of rest ass short

23:29people were aware of that part yes no

23:33you're not supposed to create an object

23:34of rest ass short class and the reason

23:36for that is if I go to the rest ass

23:38short class let's go to this particular

23:40class okay observe

23:46carefully if I go to this particular

23:48class guys all the variables are static

23:51in

23:52nature all the variables are static in

23:55nature scroll down all the methods are

23:58static in

23:59nature okay all the methods are static

24:03in nature so this is not a normal class

24:05this is a utility class what class

24:07utility class what is a utility Class A

24:10utility class is a class in which all

24:13the variables and the methods are going

24:15to be static in nature okay all the

24:19variables and methods are going to be

24:22static in nature so if you are going to

24:25have variables and methods in a class as

24:28static generally that particular class

24:30is called as utility class

24:33like the answer is yes this is something

24:36which is there now a lot of things in

24:40Java let's say if you go to a class

24:41called let's say arrays class arrays is

24:44a utility class look at the package name

24:47java.util whenever you are using or

24:50decide to use arrays

24:55class St okay similarly there's a class

24:59in Java which is called as math. random

25:03I can say math which belongs to java.

25:05Lang but it is also a utility class it

25:08has all the variables and methods as

25:09static okay so utility classes are

25:13something which is reusable component

25:15you I'm like you have to keep on using

25:17it again and again anywhere without

25:19creating the object that's the reason so

25:22rest assured is like that now in order

25:25to make a login request in rest assured

25:27or let's say I have to make a request

25:28and rest assured I can just say rest

25:32assured dot because variables and

25:34methods are static in nature what I have

25:36to use given method this is the first

25:38thing that I'm supposed to

25:44give now what is the return type of

25:47given method what does given method

25:49returns me yeah it's going to give me

25:53request specification this is the return

25:56type okay given returns you request

26:00specification so I'm just going to put

26:02it off something like this over here or

26:05let's take it in a much more different

26:06way the first thing that I want to do is

26:08I want to give the base URI so I'm going

26:11to say base

26:14UI okay what is the base URI of this

26:18application now when I was creating this

26:20application I just took things a little

26:22bit in a different way you see you will

26:25not be able to see the IP address of

26:27this or the application uh the sorry the

26:32back end C server path or the IP address

26:35over there okay this is for the security

26:38reasons okay so only if you are aware of

26:41the IP address you will be able to

26:44connect to the back end are you getting

26:47the point if you know the IP address to

26:51have API

26:52request if you try to make it from this

26:55particular URL which is written over

26:57here it's not going to work

26:58so it's a rapper that is there over here

27:01so we have to rely on this chap now so

27:05let's say the developer says that go and

27:06use the Swagger UI and uh over here I'm

27:10supposed to enter the credentials to

27:12just understand how exactly this uh

27:16login API works so I'm going to go to

27:19this API o/ login if you see carefully

27:24this is the login API API o login so I'm

27:28coming over here I'm going to say I want

27:31to try it off in the request body you

27:35give the username what was the username

27:36UD 1 2 3 4 what was the password UD 1 2

27:403 4 up

27:42execute so I am able to see the curl and

27:46I'm able to see the response coming into

27:48picture so if I will be

27:52entering this particular credentials in

27:55Json format if the header is going to be

27:58content type application Jason this

28:02becomes the end sorry the base URL of

28:05the application this becomes the base

28:08path and this becomes the end point is

28:11this part clear to everyone I'm able to

28:14see that information over

28:16here is this part clear to everyone

28:19perfect and here I'm able to see the

28:21response coming into

28:24picture so I know the base URI I'm going

28:27to copy this path go back to my

28:30application uh over here I'm going to

28:33set the base

28:35Ur next

28:39thing next thing over here rest short.

28:44base URI this is the first thing now

28:47what is restur it's a class which has

28:50methods as static now the next thing I

28:52do is I say rest assured dot given

28:56method this is the start because this is

28:59what you have to call for making the

29:02request given method returns you request

29:06specification now I'll tell you

29:08something which is very important return

29:10type Focus sub given method is going to

29:14return me request specification so if

29:17given is returning me request

29:19specification I want to store it inside

29:21a

29:22variable Java is a uh what do you call

29:26typed language so over here whatever is

29:30the data type what given is going to

29:33give me back X data type if given method

29:36is return you returning you integer

29:39value X data type should be integer if

29:42given is returning me string value X

29:45data type should be string but given is

29:47returning me what request

29:50specification so I have to use request

29:55specification now the main thing that

29:57comes into picture over here is what is

29:59request

30:01specification okay that can be an

30:03interview question what is the purpose

30:05of request

30:07specification if I have to explain you

30:09what is request specification in the

30:10simplest term it's written over here it

30:13allows you to specify how the request is

30:16going to look to my request I have to

30:19attach header to the request I want to

30:21attach body to my head uh to my request

30:24I want to attach authorization token

30:27right

30:28all those things I can handle it with

30:31request

30:32specification so whatever will be the

30:35payload end point your uh HTTP verb your

30:40body all those things I want to pass mu

30:43request

30:45specification is this part clear so this

30:48will take care of how the request is

30:50going to look okay

30:53now over

30:55here I have to attach

30:59my header okay my header is going to be

31:03pretty simple so if I go x. header I can

31:07pass the header in key value format

31:09simple key value format header pass so

31:12what is my header over here header is

31:14content type is application Json this is

31:17not really required okay this is

31:19something you can ignore it of content

31:21type application Json so I'm going to

31:23take this content type I'm going to

31:25attach it to my header

31:28and the second one is going to be

31:30application Chason just copy

31:34this double

31:36quot okay so the header key and value

31:39you need to give it in the string

31:41format now if I bring my cursor to

31:45header method header returns me what

31:49what is the return type of header you

31:51can see after the Green Dot which is

31:52written it returns you what request

31:54specification f a request specification

31:56there okay so over here let's say I

32:01create another variable called request

32:05specification I'll say y okay now to

32:09this y I want to attach the body a body

32:13is a overloaded method same method name

32:16different parameters you can pass the

32:18body from the file you can pass it in a

32:21bite array you can pass it as a p model

32:24or a pojo object you can pass it in the

32:26form of a string

32:28okay life simple pass it in the string

32:32format so I'm going to go over here and

32:34I'm going to take this entire Json as it

32:38is

32:41okay copy

32:43this paste it over

32:46here and I'm going to put it in double

32:48Cotes

32:59and now I have to fix this backwards

33:00slash

33:02backward this is correct

33:06okay

33:08body just give me a

33:12moment something went wrong but here

33:34yeah pass one remain thank you I'll fix

33:37it all thank you

33:40done bring your cursor to body what does

33:43body returns

33:44you request

33:47specification so over here I'm going to

33:50copy this put it off over here make it

33:54XY Z and then to this Zed I want to make

33:58a post request and this is where I

34:01decide to give my end point so what is

34:03the end point this is the chap I'm going

34:06to copy API

34:10login now if You observe I have given

34:13everything whatever I had I've given

34:15this it to this chat okay all the things

34:18are available at one place so over here

34:22you have the base

34:24URI you have the base URI you have the

34:27head

34:28header you have the body this is a post

34:32request and this is the end

34:35point whatever things which is required

34:38to make the request is available over

34:41here okay

34:43now if you look at the uh return type of

34:47this particular method just bring your

34:49cursor to post method and if I bring my

34:52cursor over here post is going to return

34:54you what response this is where my

34:58response comes into picture and I can

34:59say response

35:02response okay I can just say

35:04system.out.print Ln print me the

35:07response as pretty string okay as pretty

35:11string something like

35:13that now keeping my fingers crossed

35:15let's clip on run and see whether it

35:21works and here you will see

35:25that I am able

35:28to see the response I'm not testing

35:31anything as such but over here I'm able

35:33to see the response coming into picture

35:35that this is the token the type of the

35:37token is a bearer token ID is three

35:39username is UD 1 2 3 4 email address is

35:42this this is a user and if I go back to

35:45my uh response body it's the same kind

35:48of response token type ID username email

35:51rules and all those things are

35:53available

35:55now this is the script which I have

35:58written knowing nothing about rest

36:04assured variable

36:07continue so this is my script how it

36:10looks okay probably you want to do a

36:13simplest assertion I can just say assert

36:15that assert do assert equals which comes

36:18from test NG and I can say response. get

36:22me the status code and I can say status

36:25code okay that's something that I want

36:27to check over here okay so if I run this

36:30particular stuff the test runs it works

36:33but if I just change the status code of

36:35course it's going to fail something like

36:36this if I try to do it the test is going

36:39to

36:41fail okay and the reason for this

36:43particular failure is going to be

36:45assertion has failed because we were

36:48expecting the status code to be 200 but

36:51we found

36:522112

36:54okay now this is a actually the premise

36:58the starting point for our

37:01framework like J we have seen this

37:03particular script you have written the

37:04same stuff again the story is also same

37:06you don't change the story also you

37:08always come up with the same stuff

37:09creating XY Z variable and

37:11all now over here rest assured already

37:16implements something which is called as

37:18the Builder design pattern simple

37:21time if you have seen or studied what

37:25exactly methods are and how EXA exactly

37:27methods needs to be created from the LMS

37:30topic I've always said that whenever you

37:32are creating a method a method needs to

37:34return

37:35something okay void is never a good

37:39return

37:40type void is never a good return type in

37:44fact even if you look at the

37:45objectoriented part which I've kept over

37:47there okay for people you know like some

37:49people were saying that it's there in uh

37:51Hindi you just make it a little bit in

37:53English so the entire from the lecture

37:56of object Orient

37:58module all those things are in English

38:00only okay we just decided to change it

38:02off over there so all the lectures are

38:04kept in in English language so if you

38:06can use it you can study it from there

38:08so over there this void return type is a

38:11very bad return type it's not good okay

38:15test can be void test can be void your

38:19main method can be void because they are

38:20the only methods that get executed at

38:23the end return okay but any other method

38:27words that you call it's always good

38:29that they return something even when I

38:32have created the page classes I have

38:34always told that make sure the page

38:36methods returns something because if

38:39methods are going to return I can chain

38:42them

38:43together yeah do login with so and so

38:47credentials return the page object then

38:49you can connect the dashboard page

38:50object so and so forth if you're able to

38:52recollect that's something that you're

38:54supposed to do so one of the best

38:57practices whenever you are creating

38:59applications or writing any code me

39:03return in simple terms this is a method

39:06call if you are calling someone you

39:09expect them to answer it

39:12hello as simple as that okay so over

39:16here whenever there is going to be

39:19methods which are returning something

39:21you can chain them together so the

39:23script takes a little bit of maturity

39:25now he Baba if these methods can are

39:30returning the same thing request

39:32specification request

39:34specification instead of writing x x

39:38equal to rest ass short. given x equal

39:41to rest ass short. given to

39:47replace the answer is

39:50yes y do body Y is what rest assure dog.

39:55header I can take the this thing can I

39:58replace it and put it over here the

40:01answer is yes z. post I can just take

40:05this

40:07thing and I can put it off over

40:11here Association now if x = 10 y = x

40:17then y =

40:2210 are you getting the point okay I

40:25don't even need to write this line

40:28so instead of writing the same thing

40:30again and again again and again because

40:32there is this return type chaining which

40:35is happening you can keep on connecting

40:37them together rest assur dot given

40:40header body okay make the post request

40:43to the following end point response low

40:45response in the pretty format printing

40:47it off checking whether the status code

40:49is 2112 let's change it to 200 and this

40:52is where we are clear to everyone yes or

40:56no what I have written so

40:58far perfect everyone in the

41:03call yeah perfect

41:06great now comes the second concept see

41:11whenever you are using a class uh

41:14interface which is going to have static

41:17methods inside them it's always better

41:20that you do a static

41:21input the only benefit of static UT is

41:24the readability that comes into picture

41:27so if I go to rest assur class I am 100%

41:29sure K Baba all the methods and

41:31variables are static I showed you okay

41:34so whenever you are using rest assured

41:37makes sure make sure that you are doing

41:41a static

41:43UT now you'll say what is the benefit of

41:46static import P readability I don't need

41:49to write rest or short dot base U this

41:51line goes

41:53away so the script becomes this given

41:56header body and all those things so if

41:59an interview they ask why do you do

42:01static UT for rest assured the straight

42:05away answer is

42:07improves

42:10readability byy there's no change in the

42:12performance and all you don't have to

42:14write the class name dot something

42:16getting the point so without class name

42:19I'll be able to access it

42:21off now the thing that comes into

42:23picture over here

42:25is the thing that comes picture over

42:27here is this

42:30base I don't like this thing over here

42:33like your half of the family is over

42:35here one guy is sitting you know like

42:38fooling around here so it didn't look

42:40good so it's always better that you

42:41connect this also together so in your

42:45rest ass short class they have created I

42:47don't know why but they have created a

42:48method called base URI

42:52and you can just pass it off over here

43:00okay sem and you don't need this

43:04chck if I run this particular

43:08stuff the output is still the

43:11same so after some time when you start

43:15writing the script I've always said

43:17don't focus on the output script now is

43:20the time to optimize it is this part

43:23making sense output is not going to

43:25change

43:28clear to everyone so this is the script

43:31which we have

43:32written okay and this becomes your first

43:37rest assured

43:38script rest assured script coming into

43:42picture

43:45now suppose let's try to think of a

43:48bigger

43:49number tomorrow uh right now at at this

43:53particular

43:54moment I have

43:5827 apis to test okay right now can we

44:03create a class variable if base URI is

44:06same for multiple test uh I'll come to

44:09that I'll come to that in a moment you

44:11are close

44:13enough that's not the major

44:15thing start so right now guys I have 27

44:20apis to

44:21test let's try to increase the number

44:24tomorrow you have 270 apis to test

44:28then these many API you decide to test

44:32up if you try to imagine this is the

44:35test I have written for uh this is the

44:38script I have written for one API test

44:41if tomorrow the requirement is that go

44:44and test a lot of apis so I have to

44:46write a lot of test scripts a lot of

44:49classes will be created and this is how

44:52my script will

44:54look what's wrong with that the problem

44:57that comes into picture

45:01is hard

45:06coding log

45:09usern mobile OTP log is going to happen

45:13two Factor Lo authentication comes into

45:15picture and they have modified the login

45:18feature you have to make changes

45:22everywhere wherever login scripts are

45:25getting called yes or

45:29no if there is going to be any slight

45:33change that comes into picture in your

45:37uh application in your apis the entire

45:41test scripts will get

45:45modified so the problem with this script

45:48is that this is a a quite brittle script

45:51if if I'm using the word correct brittle

45:57be

45:58change and when I say to you have to

46:01come and start modifying it everywhere

46:04okay this is the problem that comes into

46:07picture are you understanding the

46:10problem statement over here that what we

46:12what we have written even though the

46:14code works correctly you are getting the

46:16output but this is not the framework or

46:19the test script that you can

46:21use is this part clear to

46:25everyone okay

46:27up then we start thinking what exactly

46:31we can do in this kind of a scenario

46:33then I go back to the Swagger document

46:35for a moment or I start observing

46:41something if You observe the Swagger dog

46:44which is in front of you either pattern

46:47in the way the apis are arranged and

46:50given to

46:52you f Authentication

46:56R

46:58apis I have a section called

47:00authentication authentication becomes a

47:03service for me and this service gives me

47:07four end points that needs to be tested

47:12so if tomorrow any change or any new API

47:16is going to come into picture for

47:20authentication if tomorrow there is

47:22going to be any modification for login

47:25this section will get updated

47:28so over here if I tell you guys to

47:32imagine

47:33this as a

47:36class imagine this as a class that I

47:39have an authentication class get post

47:42put delete these are all methods HTTP

47:46methods forgot password will become a

47:49method login will become a method reset

47:53password is going to become method sign

47:56up is going to become become a method so

47:58what I'm able to imagine at this

48:00particular moment is I'm going to have

48:02an

48:03authentication Service class which has

48:07four methods inside them forgot password

48:10login password reset uh login reset

48:14password and sign up these are the

48:17functionalities of my

48:20authentication are you able to connect

48:23to this

48:24thing okay that when I look at Swagger

48:28documentation this is how the structure

48:30is given to us yes or no this is the

48:34first thing unless you

48:37imagine okay so this is something you

48:40need to First Connect that this is what

48:41I'm able to see I'm like okay

48:45now the story starts over here we again

48:48go back to the script I'm again saying

48:50story starts over there's there's

48:51another thing that comes into picture

48:53over here let's go back to the script

48:57now the next thing what swap was saying

49:02B right because this is common to all

49:07my end points or my services this is

49:10base URL it is going to be common to all

49:13the services which is coming into

49:15picture so if something is

49:19common if something is

49:21common okay and you are able to see that

49:25contact controller is going to become a

49:27class admin controller is going to

49:30become class authentication controller

49:32is going to become class kyc controller

49:35is going to become class and there is

49:37something common which I want to share

49:39it across

49:41everyone how can I do

49:44that you will say either make it

49:48static I'm able to see that there can be

49:51a component coming into picture which I

49:54can call it as a base service where

49:57whatever is common across all these

50:01service components I can keep it off

50:03over here make sense to

50:06everyone yes or no anything which is

50:10common okay across all these Services I

50:14can keep it in the base

50:16service what can be common if I go back

50:20to my

50:22script given base URI header to

50:30request

50:31specification in every test script that

50:34you will be writing will you create a

50:36request specification will you use the

50:39given method let's say there are 10 15

50:42test scripts I have written given method

50:45call yes or

50:47no will you write given method for all

50:51those test scripts yes or no will this

50:54method given method would have been

50:55called in all the test yes or

50:58no yes or no given method what I've been

51:01called now I have called it over here

51:02also for this method here also so the

51:06thing is given method is common but what

51:09is given method giving me request

51:12specification so the thing my dear

51:14friends is base service will be

51:18responsible for setting

51:23up request specification

51:28is this part clear to

51:31everyone is this part clear to

51:34everyone so this is where the new

51:37component of your automation framework

51:39or I would say the first component of

51:40your automation framework comes into

51:42picture which is

51:45your pace service so let's go back and

51:49what I decide is I decide to create a

51:52new package you can create it in SRC

51:55main Java you can create it in SRC test

52:00Java I'll create it in SRC test Java I'm

52:03going to create this particular package

52:04and I'm going to call this particular

52:06package as com. api.

52:09base and over here this introduces a

52:14new um design pattern which is the

52:20service object model okay so I'm going

52:23to come to that but I'm going to call

52:25first this as AP

52:27uh sorry Base

52:29Service that's the name of my

52:32class I'll write it down for you what

52:34exactly this class is going to do this

52:36class is going to be

52:37responsible for handling the base

52:42URI IP address hand second thing is it

52:46is going to be responsible for

52:49creating the the request

52:57is this part clear to everyone it is

52:59also going to be responsible for

53:02handling the

53:07response so this is the rapper for your

53:10rest assur in simple terms if I have to

53:13explain yeah rapper for rest

53:16assur because this is where abstraction

53:19starts to come into picture hold on hold

53:21on I'll show what

53:24happens now over here the first thing

53:28that I decide to do

53:30is I decide to create a private string

53:36variable called base URL okay and I'm

53:40going to initialize this

53:42chap with this

53:45guy so I'm going to take it from here or

53:47you can take it from anywhere wherever

53:48you want man so you can just go to login

53:51okay yeah this is the chap you good

53:56put it over

53:59here is this a constant the answer is

54:02yes constants are always going to be

54:04written in

54:06uppercase okay if anything is constant

54:08it is going to be marked with final

54:10keyword if something becomes final

54:14static because final will never come

54:16alone final will come with static for

54:19variables not for methods is this part

54:22clear to

54:24everyone is this part clear to

54:27everyone yes or

54:30no let's go to the documentation for a

54:33moment over

54:38here okay first I've added the

54:40dependencies just to repeat it off I

54:43created the test this is my test script

54:46and over here we are introducing a new

54:48design pattern which is called a service

54:49object model I'll come to this

54:51particular document in a moment don't

54:52worry about it but over here this is the

54:55base service which you

54:56see okay the base service class and what

55:00this Base Service class I'm not able to

55:02zoom it

55:09let's this is the base service class and

55:12what this Base Service class is doing it

55:14has a instance variable here Ive just

55:17kept the snippet mean I'm doing it over

55:19there take what is this config manager

55:21and all don't worry protected request

55:24specification I'm creating a off and it

55:27is going to have a

55:29Constructor by mistake it is written

55:31protected it should be public okay so

55:33over here this will become

55:46public so over here you just create an

55:50instance variable private

55:53request specification request

55:57specification and I'm going to have a

55:59Constructor over here a default

56:01Constructor and job of the default

56:03Constructor what is the job of the

56:05Constructor what is the job of the

56:07Constructor to initialize the instance

56:10variable varable is base URL my instance

56:14variable is base URL my instance

56:16variable static variable this becomes

56:19the class variable only request

56:21specification will be initialized so I'm

56:24going to say base request specification

56:27equal to rest short dot

56:31given because given method returns me

56:34the given method returns me the request

56:37specification to this request

56:39specification I will attach the base

56:43URL this over here is the exact same

56:48line which you see in the login API

56:54test yes or no

56:57isn't just the same

57:00line clear to everyone yes or

57:05no exactly I could have done the static

57:08import but right now I am not like if

57:10you want you can do that it's not a big

57:11thing I can just see over here static

57:14import but the only thing is I have

57:16changed it off and instead of mugging up

57:18these things now just remember the rule

57:22what is the rule request specification

57:23is instance variable initialize

57:27Constructor so inside the Constructor I

57:30need to create initialize request

57:32specification I cannot create an object

57:35of request specification because this

57:36chap is an

57:39interface so over here whenever you have

57:41to create request specification you have

57:43to write given. base URI and pass the

57:46URL is this part

57:49clear yes or no can I go

57:52ahead now the requirement is

57:57he Baba I will create a post

58:00request because if you go to the login

58:02API

58:04test over here you are attaching the

58:08header you are passing the body and you

58:11are making the post request out of all

58:14these

58:15things the data is hardcoded but up

58:19attach header you are passing the body

58:22and you are making the post request so

58:25here I'm doing three method called

58:27header body post so I go to the base

58:29service and I will

58:32say Baba I will create a

58:36method

58:39protected

58:41post is going to be my

58:44method or I can say post

58:47request in order to make the post

58:50request I need three things header body

58:56and end point but I'm only going to give

58:59two

59:01string body or use a technical term

59:06payload next what do I

59:08need end

59:15point

59:18okay

59:23now imagine request specification was

59:26set either request how would you have

59:29made it request specification

59:33dot

59:35dot over here over here I want to attach

59:40the body body I will pass in the string

59:44format pass

59:47payload and I will make the post request

59:50to this end

59:53point clear

59:57is this part clear I will be giving the

59:58payload I will be giving the endpoint

1:00:02and over here this request will be made

1:00:05is this part clear to

1:00:07everyone yes or

1:00:10no is this part clear to everyone let me

1:00:13read this

1:00:14stuff now what does post method returns

1:00:19me what does post method returns you if

1:00:22I bring my cursor over response response

1:00:24response thank you

1:00:26but I did a cheating in order to make

1:00:28post request I need three things header

1:00:32next body that is the payload and the

1:00:35end

1:00:37point so what I can do is I can use

1:00:39something which is the inbuilt

1:00:41functionality called content type

1:00:43because he was passing the content type

1:00:45is application Json so over here I can

1:00:49use this content type method and I can

1:00:52just say content type which is my enum

1:00:56and content type is going to be Json

1:00:59up okay J what if I have to attach other

1:01:02headers wait will come to that my major

1:01:06focus is only on login apart from me

1:01:08login

1:01:10exist okay so request specification do

1:01:13content type it is going to take care of

1:01:16attaching content type as Json body

1:01:19whatever the body I'm passing and end

1:01:21point now this entire thing returns me

1:01:24what look at the last method post post

1:01:27returns mean

1:01:30response void is a very bad return type

1:01:34so now tell me what this request what

1:01:36this method is going to return me respon

1:01:40finish done

1:01:41congrats okay

1:01:45done okay this is something that we have

1:01:47created so I have created the base

1:01:50service and what this Base Service is it

1:01:53is a wrapper over your rest assured

1:01:56in your selenium I created browser

1:01:59utility which was rapper over selenium

1:02:01web

1:02:02driver okay so in life whenever you want

1:02:05to make things better create a

1:02:08rapper now the next thing that comes

1:02:12into

1:02:14picture this is the base

1:02:17service but

1:02:20service controller admin controller

1:02:24authentication we are focusing in only

1:02:26on

1:02:27authentication so what we will do over

1:02:29here guys is I'm going to create a class

1:02:31inside API

1:02:33base and I'm going to call this

1:02:35particular class okay

1:02:39as as

1:02:41uh o

1:02:44service o service is going to depict

1:02:47this

1:02:48chap

1:02:52tab now service is going to have a

1:02:56relationship with base service so I'm

1:02:59going to say all service extends Base

1:03:02Service is this part clear to everyone

1:03:06so the request specification variable

1:03:09the post method which I have created I

1:03:11can access it over here over here I am

1:03:14going to create

1:03:16a variable called base underscore U path

1:03:21base path

1:03:22sorry and base path is

1:03:28API forward slash either I sorry over

1:03:32here I'm just going to take this path

1:03:33API

1:03:42for/ API underscore path this is

1:03:45constant across all my uh

1:03:50HTTP uh end points for this

1:03:54authentication Service forgot password

1:03:56May login May reset password May sign in

1:03:59API API API

1:04:01API this is constant constants are

1:04:04always marked with final

1:04:07keyword

1:04:09final static be and we will write it in

1:04:13Upper Pie as simple as that now the next

1:04:16thing that comes into picture over

1:04:18here o service may all service has a

1:04:23method called login

1:04:25I hope this part is now making sense Au

1:04:28service is going to have a

1:04:31method called

1:04:34login public void

1:04:37login in order to make a login request

1:04:41what do I

1:04:42need I need the

1:04:46payload end point I'll give the end

1:04:49point login method will internally

1:04:53call the Post request you're going to

1:04:56pass the payload and endpoint will be

1:05:00attached here because of course if it's

1:05:02going to be login method log

1:05:06method okay is this part clear to

1:05:10everyone so login I will be passing the

1:05:14payload and this login method internally

1:05:18calls the post

1:05:19request I want to ask you post request

1:05:23return the post request that we have cre

1:05:25cre it returns

1:05:28response

1:05:32return and if post request return

1:05:35whatever post request is giving so what

1:05:36will be the return type of this method

1:05:41response and congratulations you have

1:05:44created your first

1:05:46service that is the authentication

1:05:48Service authentication Service has a

1:05:50endpoint called

1:05:52login call you will be passing the p

1:05:56Lo

1:05:57okay now how exactly my test looks then

1:06:01it takes me to the third

1:06:04level where I don't need any of these

1:06:07chaps

1:06:09anymore login test start telling me from

1:06:13the Swagger login HTTP or login endpoint

1:06:17belongs to with

1:06:18service login uh uh endpoint belongs to

1:06:22authentication Service so I have to

1:06:25create an object of authentication

1:06:34Service o service has

1:06:37multiple uh what you call end points kco

1:06:41test login Au service. login I need to

1:06:46pass the payload over here so payload

1:06:49I'll just copy it from here

1:06:53okay and I attach it over here

1:07:02login returns me

1:07:05whaton response finish story is over

1:07:08here response uh

1:07:11response and I can just say

1:07:13system.out.print Ln if everything works

1:07:16correctly the way we want over here I

1:07:18have to put a disclaimer because you

1:07:19know like while talking I can just make

1:07:22a mistake but let's see if it works okay

1:07:25if I click on the Run button and if

1:07:27everything works

1:07:29correctly by output

1:07:31are no see something went wrong but

1:07:34we'll check on that part so over here

1:07:37you see I'm getting an error

1:07:40unauthorized and uh if I am trying to

1:07:43let's try to debug what went wrong over

1:07:46here let's go to it's

1:07:50not ah smart Chu so just take the B path

1:07:54smart logo

1:07:56done finish base path plus forward SL

1:08:00login now if I click on the play button

1:08:06okay if I bring Tada

1:08:09done okay so like yeah benefit mil the

1:08:14benefit is from where you started and

1:08:16where you ended the first test which I

1:08:19wrote was

1:08:21this the second test which I wrote was

1:08:25this

1:08:26this the third test which I wrote over

1:08:29here is

1:08:32this F is tomorrow if my manager says

1:08:36Baba go and run only authentication

1:08:37Service

1:08:39Test authentication Service

1:08:43methods are you getting the point so if

1:08:45I'm going to have multiple microservices

1:08:48and out of those microservices I only

1:08:51want to test certain microservices I

1:08:53don't want to test all I just want to

1:08:56test authentication I want to test only

1:08:59kyc object

1:09:02methods are you getting the point is

1:09:05this part making sense to everyone so

1:09:08even the segregation the management

1:09:10becomes better in this

1:09:12approach this is what you call as your

1:09:15service object

1:09:17model you use page object model in your

1:09:21UI automation framework in your API

1:09:24automation framework you use service

1:09:26object model so basically the purpose of

1:09:29subject uh service object model is to

1:09:31handle the business logic and

1:09:32application rules where did I handle the

1:09:35business logic handle authentication

1:09:38Service has an endpoint called login it

1:09:41will make the post

1:09:44request return whatever you want to test

1:09:46that is up to you I will return you the

1:09:48response you test whatever you want the

1:09:51next thing that comes into picture is it

1:09:53is only going to have business and

1:09:55service layer so that's the

1:09:57reason

1:09:59Services I have created I will create

1:10:02the respective service class for them

1:10:05make sense to whatever you are seeing

1:10:07now you start imagining K Baba account

1:10:10controller this will become my class it

1:10:12is going to have three methods post

1:10:15account account and pass the account

1:10:17number account and it is going to have

1:10:19user okay admin controller it is going

1:10:22to have 1 2 3 4 5 6 six 7even eight

1:10:26eight methods this particular class

1:10:29authentication will have four methods

1:10:32user management is going to have five

1:10:34methods is this part clear this is how

1:10:37you will structure it

1:10:39off yes or no is this part clear to

1:10:42everyone there one question here so if

1:10:45we want to test any flow like first of

1:10:48all login then some other API and then

1:10:50some other so this type of thing will

1:10:53work in that case of course you start

1:10:55creating the objects in certain way

1:10:58first you will call the authentication

1:11:00login API then you will create the

1:11:02object of admin controller and you will

1:11:05call that method then you will create

1:11:07let's say account controller whatever

1:11:09you want I have done that particular

1:11:10flow also I'll show it in probably

1:11:13tomorrow's class or something CH but

1:11:15keep on creating the object if you want

1:11:17to

1:11:19see where good question just give me a

1:11:23moment h

1:11:27can you see API automation framework

1:11:38H first create o service you see I'll

1:11:41come to the script

1:11:43over okay I will get the token you see I

1:11:47will attach the token to user service

1:11:49and I'm taking the token from the

1:11:51authentication Service I'm giving it to

1:11:54the user service

1:11:57service make sense I'm taking the data

1:12:01from like then that token I'm giving it

1:12:03to update user profile service so these

1:12:06are different methods one method second

1:12:09method third method so on and so forth

1:12:12getting the point so every time I'm

1:12:15creating a different

1:12:17object for that service clear

1:12:22then service

1:12:27make

1:12:31sense okay that becomes

1:12:34easier thank you any other questions can

1:12:37I go

1:12:42ahead can I go ahead

1:12:44yes but we have a problem here also

1:12:48you'll be like J hard code data yeah

1:12:52this is the problem hard coding is bad

1:12:55so over here we will create the next

1:12:58component of your framework which you

1:12:59are pretty much aware of I've taught you

1:13:01n number of times which is

1:13:03Ojos okay another the term for pojo for

1:13:07these days not these days they

1:13:09technically call it off models so I'm

1:13:12going to create something called

1:13:15models com. api. models and what are

1:13:19models in simple terms if I have to

1:13:20explain

1:13:22you so if I go to login open this

1:13:26chat I have a request

1:13:29payload I have a response payload so I

1:13:34will create a request model I will

1:13:37create a response model so over here I

1:13:40have to create a Java class which

1:13:42depicts this chap so what I'm going to

1:13:45do I'm going to right click create a new

1:13:48uh package and I'm going to call this as

1:13:52request request

1:13:55request

1:13:56package then I'm going to create a new

1:13:59package and I'm going to call this as

1:14:03response so all my response models will

1:14:06be kept over here but first let's focus

1:14:09on request model and I'm going to call

1:14:11this as login

1:14:13request and over here my job is pretty

1:14:16simple just create a pojo

1:14:22class okay this depicts username and

1:14:29password right click go to Source

1:14:32generate the Constructor using the

1:14:34fields right click go to Source generate

1:14:37the uh Getters and

1:14:40Setters right click go to Source

1:14:43generate the two string

1:14:45method

1:14:47done can I save it

1:14:49yes

1:14:52up save it now now we have to go to the

1:14:56API

1:14:57test and here the story takes a

1:15:00different

1:15:01turn login method requires the data in

1:15:04which

1:15:06format login data requires the data in

1:15:09which

1:15:10format string string

1:15:13format

1:15:15now I will be creating a Java

1:15:19object okay converting Java object into

1:15:23Json object is called as

1:15:27serialization okay for that which

1:15:29Library comes into picture your Jackson

1:15:31Jon all those libraries come into

1:15:34picture but I want to take things to a

1:15:37different level now over here if I ask

1:15:42you this is Java

1:15:51concept who is the parent of login

1:15:53request

1:15:57which class is the parent class for

1:15:59login request object object class object

1:16:02class first

1:16:03thing now for people who are not aware

1:16:06of this thing whenever you create a

1:16:08class now let's say you decide to create

1:16:10a class you see automatically there's a

1:16:12super class which is written java. lang.

1:16:15object um the other way I look at it is

1:16:18like my used to

1:16:21say if you don't give it to your if you

1:16:24don't don't give a parent to your class

1:16:27Java gives a implicit parent call object

1:16:30class Java gives a implicit parent call

1:16:33object class so object class is like a

1:16:35God God

1:16:39class okay so over here this particular

1:16:43class is going to play a very important

1:16:45role in a moment so what I'm am going to

1:16:47do

1:16:48is uh instead of passing this like this

1:16:54I will create a login request

1:16:58poo Okay uh that is a login request

1:17:02object so I'm going to say login

1:17:04request login request equal to new login

1:17:13request 2

1:17:153 2

1:17:1734

1:17:19okay and I will pass it off over

1:17:23here now

1:17:27log

1:17:29request L sorry login method what I'm

1:17:33passing over here login request login

1:17:35request pojo reference but this login

1:17:38method requires string value I'll say

1:17:40I'm going to come over here and I'm

1:17:41going to change it I'm going to say

1:17:44login

1:17:46request I'm going to go to the Post

1:17:48request and now change it to login

1:17:52request

1:17:55the issue is solved okay if I come back

1:17:59over here save

1:18:01it and if I try to run the program you

1:18:05will see something that is happening

1:18:06over

1:18:08here the test fails of course what did I

1:18:14expect can I pass just a normal pojo

1:18:17object and it's going to take care of it

1:18:18on its own but the answer is no because

1:18:22we have not serialized it okay so cannot

1:18:25serialize object because no Jason

1:18:28serializer found in class path please

1:18:32put Jackson gon Johnson Yassin whatever

1:18:37these libraries are like this library is

1:18:40not there so I'm going to go to the p.

1:18:42XML file my dear

1:18:44friends I'm going to scroll down okay

1:18:48and what we will do over here

1:18:50is if you go to the documentation

1:18:56uh yeah whenever you are working with

1:19:00Jackson there are going to be three

1:19:02libraries that you are supposed to use

1:19:05okay those three

1:19:07libraries those three libraries just

1:19:10give me one moment here

1:19:16uh those three libraries are going to be

1:19:19data bind core

1:19:22or did I miss something annotations this

1:19:26is something which is wrong over here

1:19:27I'll fix it off you need data bind core

1:19:30and annotation te Library okay so this

1:19:34is something that you need to add it off

1:19:35I'm just going to copy

1:19:37this go back to the pom.xml

1:19:40introduce this

1:19:43dependencies okay core and data bind I

1:19:46have added it off so if I going to click

1:19:48on the play button now

1:19:59just give me a

1:20:01moment but click on the play button

1:20:09now did it

1:20:13work so when you introduce the Jackson

1:20:17Library you don't have to write the

1:20:19script of converting it into your uh

1:20:24Java Json object okay you don't need to

1:20:26convert it into two string and two Json

1:20:29and put it off over there it can take it

1:20:31on its own is this part clear to

1:20:33everyone see the

1:20:36object

1:20:38provided those two dependencies were

1:20:41there is this part clear to

1:20:44everyone what I've done so

1:20:46far yes or

1:20:48no is this part clear to everyone

1:20:55are we on the same

1:20:59page so what has changed over here which

1:21:02is something which is interesting that

1:21:03you are not serializing it by yourself

1:21:06inbuilt rest assur is taking it for for

1:21:08you but you have introduced a major

1:21:13problem output R what can be the problem

1:21:16the problem

1:21:17is if I go to the login this is fine you

1:21:22are passing the login request

1:21:26okay the post request method which is

1:21:30should be a generalized

1:21:38method there is not one um end point

1:21:43which has post request right so I can I

1:21:46have to make forgot password so that

1:21:48forgot password I have to pass a a pojo

1:21:51which is just going to have email makes

1:21:55sense me no so the rule of java says

1:22:02whenever remember this like generally

1:22:04people don't talk about it like this so

1:22:06but remember it this is a rule over

1:22:08here did you create the object of login

1:22:11request my question is to you this did

1:22:14you create the object of login request

1:22:16script L request

1:22:18object yes or no

1:22:22yes this cannot be the parameter

1:22:28if you are going to create a method okay

1:22:31and you will be deciding to pass a class

1:22:35reference over

1:22:38here

1:22:44reference okay

1:22:47so if I'll will be creating an object of

1:22:52login request

1:22:58okay in this particular

1:23:01method I have to make sure that this

1:23:04method is Loosely coupled so that it's

1:23:06like a Lego piece tomorrow if you give

1:23:07me a different pojo I should be able to

1:23:09handle it you will pass the parent

1:23:12reference over here who is the parent of

1:23:15login request

1:23:18object so just change one word from

1:23:22login request to pojo and you make this

1:23:26particular method Loosely couple so

1:23:29tomorrow if I'll be calling the forgot

1:23:33password post

1:23:36request provided I'm giving the end

1:23:38point correctly that's it okay so this

1:23:41is what you need to do whenever you try

1:23:43to create a

1:23:45universal uh method it should handle it

1:23:49properly this is what you call as

1:23:50polymorphism

1:23:56and now you see I still don't have any

1:23:57compilation error it works okay but this

1:24:01method has become Loosely coupled

1:24:03now all right so I save it run

1:24:08it the output should not

1:24:11change life is

1:24:13good I need 20 30 minutes

1:24:16more over here

1:24:19guys did you understand the script so

1:24:21far what I have written

1:24:25okay look at the four lines is this four

1:24:27lines clear to

1:24:33everyone is this part clear to everyone

1:24:35perfect

1:24:37now the next thing that comes over

1:24:40here is if serialization is there

1:24:44deserialization will come into pitch I

1:24:47have to deserialize this response now so

1:24:50I have to create a model for the

1:24:54response I'm going to create a class in

1:24:56the com. API model. response and I'm

1:24:59going to call this particular class as

1:25:00login

1:25:03response login

1:25:06response

1:25:08okay private

1:25:13string uh

1:25:17token

1:25:20type is going to be string because

1:25:24type is storing beer what will be the

1:25:27type for ID what will be the data type

1:25:30of integer

1:25:33integer okay integer username

1:25:46string then we have

1:25:51email don't change the variable names

1:25:54whatever is

1:25:55a this key name given just use the same

1:25:57stuff roles is

1:26:00what roles is what AR Json AR what you

1:26:04can do is you can create a list of

1:26:07string you can create an array it

1:26:09doesn't really matter but I'll create a

1:26:10list of string and I'm going to say

1:26:12roles kah nothing that's it okay because

1:26:17it just has a value roles okay if it was

1:26:20having another Json object then I have

1:26:22to create a Json object uh model for

1:26:25that also okay we don't have that so I'm

1:26:28going to right

1:26:31click this is something which I've

1:26:33created right click Source generate the

1:26:35Constructor using the fields generate

1:26:38right click Source generate the two

1:26:40string

1:26:45method generate the two string uh

1:26:50method okay and I also need the Getters

1:26:54and

1:27:01Setter save it save it now let's go back

1:27:04to the login request 3 because it's time

1:27:07to Der serialize it off so over

1:27:11here over

1:27:14here if I want to deserialize

1:27:17it I can just say

1:27:20response dot

1:27:22as and over here you are supposed to

1:27:25pass the class

1:27:28reference

1:27:30response model login response so I'm

1:27:35going to say response of

1:27:38login response do

1:27:41class this CH is going to give me a

1:27:44login response object so over here this

1:27:49was the login request object we created

1:27:51a login request uh reference variable so

1:27:56now I'll be

1:28:04creating like what is the benefit of

1:28:12it that I can retrieve individual

1:28:16values I can say login request login

1:28:19response dot what do you want token get

1:28:23me the

1:28:25token let's click on the play button if

1:28:29life is good it should print the

1:28:31data but

1:28:33up and the reason for the failure is

1:28:36because it does not have a default

1:28:38Constructor I know that particular issue

1:28:39but the thing is you need to create a

1:28:41default Constructor so if I go back to

1:28:43the login response one more

1:28:47time just create a default Constructor

1:28:49what is a default Constructor a

1:28:52Constructor which does not have any

1:28:54parameter it's called as a default

1:28:56Constructor

1:28:58finish okay

1:29:03done can you see the token value which

1:29:05is getting

1:29:06printed this is the entire Json

1:29:11object

1:29:13deserialize and I'm printing get me the

1:29:16token I got the token if tomorrow you

1:29:19say that get me the

1:29:21username can I get it yes we have the

1:29:23get and

1:29:25sets individual values I can say login

1:29:31response login response. get

1:29:34me the what

1:29:39email system.out.print Ln what else you

1:29:42want login

1:29:45response dot get me

1:29:49the

1:29:51ID so email address ID token all these

1:29:56things will be

1:29:59printed Raj gmail.com is the email

1:30:02address three is the

1:30:05token can I test all these things

1:30:08yes assert do assert equals what do you

1:30:11want to test that take this

1:30:14chap put it off over here token token Co

1:30:19I think we can check whether it should

1:30:21be not null okay so I'm just going not

1:30:25equal

1:30:26to okay and then it is going to become

1:30:29true because it's an alpha numeric

1:30:31number right you can't really check on

1:30:33that stuff so the next thing that comes

1:30:36into picture is uh I want to check for

1:30:40email and email

1:31:08next is what

1:31:15id done bro

1:31:20finish okay first I printed it off you

1:31:22don't really want to print it but just

1:31:24want to show

1:31:26it okay uh

1:31:29sure the the thing that comes into

1:31:31picture is this as is a special method

1:31:35and the job of as method is it is going

1:31:37to convert the response body and map it

1:31:40into Java

1:31:45object okay and internally it is going

1:31:48to call your uh Jason utility or Jackson

1:31:52utility my bad okay okay so over here

1:31:55whatever is the response body that you

1:31:57will be getting okay it is going to

1:32:00convert that Jon object into Java object

1:32:04and it is going to return that Java

1:32:06object of that particular

1:32:08class Lo

1:32:11response

1:32:13response so if it's going to give me a l

1:32:17response Lan response refence reference

1:32:19variable right that's

1:32:22all

1:32:25clear yes how to make EnV file when we

1:32:29have different environment and base URLs

1:32:31why do I need a default Constructor uh

1:32:34that is the requirement of Jackson in

1:32:36your class only I showed you that part

1:32:38whenever you are working with Jackson it

1:32:41requires a default Constructor

1:32:44gon

1:32:48okay over

1:32:52here just to to explain this particular

1:32:55line just for your

1:32:56Simplicity response

1:32:59format it's coming in a Json

1:33:02format the purpose of as method is to

1:33:05convert your your Json object into the

1:33:11Java object of your type so over here

1:33:16what it is going to do is whatever the

1:33:18response which will come into

1:33:20picture okay I'm saying convert it into

1:33:24the Java object of login

1:33:28response so this entire line actually

1:33:31returns you

1:33:38this

1:33:41object right that's what is going to

1:33:44happen make sense

1:34:00would you please show the Au service

1:34:02class and serialization done I haven't

1:34:05uh done the serial okay I'll show you

1:34:07the class I'll just walk through the

1:34:09entire code but before that I'll just

1:34:11take one question which is there

1:34:13uh how to make EnV file when we have

1:34:17different environments and base URL

1:34:21uh I'll take that part later but but the

1:34:24same thing we have done it in the

1:34:26property files there's something called

1:34:27as Maven profiling I I got your question

1:34:30over here but the best way to handle it

1:34:32off is

1:34:34not via Java code but with Maven

1:34:37profiling so just to explain you in

1:34:39simple terms what Maven profiling gives

1:34:41you the

1:34:43functionality is I can create one

1:34:46profile for Dev

1:34:48environment one profile for QA

1:34:52environment one profile file for

1:34:56uat okay that is something you can

1:34:59do if you go to the tell it in for

1:35:02question over there I had created system

1:35:06properties when you're going to run your

1:35:08program M and run or okay and you're

1:35:10going to uh pass those things uh the

1:35:12parameters and all those things so that

1:35:15time I can pass the environment let's

1:35:18say I write over Dev so I have to create

1:35:21a structure in such a way I have to

1:35:22write the code in such way that it start

1:35:24picking up the dev property file in

1:35:27which you will have your respective base

1:35:29URL tell it C fourth fifth

1:35:33part okay that's where I've soled that

1:35:35particular stuff okay you'll find it

1:35:38over

1:35:40there if you want to go with that

1:35:41particular stuff profiling I'll keep it

1:35:43off over there could you please show the

1:35:45OD service class okay I'll I'll just go

1:35:47through the entire question one more

1:35:49time can I ask one question so if you

1:35:53have in one environment even for one

1:35:55environment my basl is a different

1:35:59different different Services has a

1:36:01difference base URL Bas URL uh different

1:36:06Services yeah just like I inan Telecom

1:36:09so so for the OS mean a provisioning API

1:36:14has a different base URL something like

1:36:17uh uh deactivation activation has a

1:36:20different URL so all Bas URL different

1:36:27sense see if you look at you have to

1:36:30focus it on the base layer

1:36:32itself in the Constructor I'm setting

1:36:34the base

1:36:38URI base U setting it off over here I

1:36:42can put it into the respective

1:36:46path and I will pass it to the request

1:36:48also make sense so when I'll be making

1:36:51the post request I will pass the end

1:36:53point also

1:36:54along with the base URL getting the

1:36:58point only the things which are common I

1:37:01have kept so if tomorrow you say that

1:37:03Baba no the base URI will be different

1:37:06for all the services let's say Au

1:37:08Services there I have user service also

1:37:10coming into picture so that time what I

1:37:14will do is I will try maybe overload

1:37:16this particular method for now and I can

1:37:18just say that I will be giving the base

1:37:22URL and

1:37:24the script Remains the Same request

1:37:27specification dot base URI pass base URI

1:37:33make sense and this particular base URI

1:37:36I will be creating it as a variable over

1:37:39here because tomorrow if I want to make

1:37:41any change I can take it from here are

1:37:44you getting the point yeah got it

1:37:47because see you if your class let's say

1:37:51if your service class have their

1:37:54respective data class as simple as that

1:37:57just to take this particular question a

1:37:59little bit over because it's a good

1:38:00question let's say I have different

1:38:04Services which are running on different

1:38:06IP addresses or different uh containers

1:38:09so over here let's say uh this works on

1:38:14something let's say as

1:38:1613959

1:38:189196 this works on

1:38:206484 okay uh

1:38:247196 I don't know this is

1:38:27192.168 9191 something like that this is

1:38:30au

1:38:31service this is uh user service uh this

1:38:35is uh going to be let's say UPI service

1:38:38something like

1:38:44that that's the reason base path basw

1:38:48was something which was responsive was

1:38:50common only to O service be end points

1:38:54there I created over there now if this

1:38:57information is also related to the OD

1:39:02service oh Baba it has to sit here only

1:39:04now I have to create it over here I

1:39:07cannot give it to the base

1:39:09service but what is common across all

1:39:12these Services he Baba you will be

1:39:15making the post request you will be

1:39:17making the get request you will be

1:39:19making the put and patch and S request B

1:39:24you will be getting the response

1:39:27back makes

1:39:31sense is this part making sense

1:39:33now so when you have those informations

1:39:36you can keep it in the respective

1:39:38classes okay and then pass it off over

1:39:42there I hope it I have answered it off

1:39:45now uh just to take thank you yes this

1:39:49is the entire documentation guys if if

1:39:51you if you don't have any questions you

1:39:52can leave it off uh leave for now pretty

1:39:54late for you guys um you can just go

1:39:57through this entire documentation what

1:39:59I've written over here so far for day

1:40:01two day one in tomorrow's class uh I'll

1:40:04just probably just focus on logging

1:40:07reporting and uh you know uh filters all

1:40:13those things which requires listeners

1:40:14and all uh running the test in parallel

1:40:16mode and something all those things I'll

1:40:18do it off all right so that's something

1:40:21that I'll be doing it in tomorrow's

1:40:22class if you guys are free you can

1:40:23follow the document and you can practice

1:40:25It Off by yourself okay see if you're

1:40:27able to do it okay whether you want to

1:40:29run a particular Suite whether you want

1:40:31to run it in the parallel mode whether

1:40:33you want to run a certain service that's

1:40:36the most important thing because if

1:40:37tomorrow I just want to run Au or user

1:40:39service I can just do that okay that's

1:40:43something that we have complete control

1:40:45on so uh that's the

1:40:49thing tomorrow can you take one flow

1:40:52like for 2 three apis that you have

1:40:54shown earlier 2 three apis yeah I'll do

1:40:57that part okay now of course you will

1:41:01not get it for the first time because

1:41:03unless you have written the code over

1:41:04here but the thing

1:41:08is step by step

1:41:11follow

1:41:13now uh the flow what we have built so

1:41:17far if I go back to the login request 3

1:41:21guys I've have created the o service the

1:41:24OD service is going to have its

1:41:27respective base path and inside this

1:41:29base path is API forward SL okay so over

1:41:34here this is API for/ common everywhere

1:41:37so you have to make sure that this layer

1:41:38is there everywhere next thing inside

1:41:42the OD service I have this login method

1:41:45that is the login endpoint meod

1:41:48internally it calls the post request

1:41:50from the base service which is this

1:41:52chart

1:41:54over here there is no serialization

1:41:56happening no deserialization happening

1:41:58nothing is happening over here okay now

1:42:02over here request specification content

1:42:04type body payload the only change that I

1:42:07have made over here is my payload is of

1:42:11object

1:42:13type Whoever has asked this particular

1:42:15question is of object type why object

1:42:18type because I have a login request pojo

1:42:21class who is the parent of this

1:42:22particular class

1:42:24object so whenever you are passing

1:42:27parameter of a particular class just

1:42:33object that's the reason you know like

1:42:35you have those when you're doing

1:42:38inheritance you write something like

1:42:39this person P equal to new

1:42:43student okay because it is going to give

1:42:45you the flexibility of polymorphism

1:42:47coming into

1:42:49picture okay this is something that we

1:42:52always do

1:42:59so okay so over here the next thing that

1:43:04comes into picture is I have created the

1:43:07object of login request like why you did

1:43:09not write object over it doesn't matter

1:43:11for me because it's it's even if you put

1:43:13object over it will still work so over

1:43:17here um all service I'm doing login I'll

1:43:20be getting the

1:43:21response now now when we are passing or

1:43:25calling the login request I'm directly

1:43:27passing the login request

1:43:30reference it's directly getting passed

1:43:33now rest assured takes care of your

1:43:35serialization and deserialization

1:43:37internally

1:43:39could so for that you just need to make

1:43:42sure that your libraries Jackson or gson

1:43:45whatever you are using it should be

1:43:47added and kept is this part clear so

1:43:50data bind and core I have added it off

1:43:52so these two things which should be

1:43:54there the next thing that comes into

1:43:57picture over here

1:44:01is when I'll be getting the response

1:44:04back I will deserialize the response by

1:44:06calling the as method response I'll be

1:44:09getting it in the Json format I want to

1:44:11convert it into the object Java object

1:44:14of a certain class so all the request

1:44:17and response I kept it over here in the

1:44:19model section models. request consist of

1:44:23all the request payload and models.

1:44:26response consist of all your response

1:44:28payload

1:44:31response just for the management

1:44:33sake and then once I get the response

1:44:36this is just to show the pretty response

1:44:38okay once I deserialize it response.

1:44:41getet token is going to get me the token

1:44:43login response. getet email is going to

1:44:45get me the email of the response that is

1:44:48Raj gmail.com is getting printed over

1:44:51here right

1:44:54and then is three coming into picture

1:44:56that is ID is going to be three as

1:44:58simple as

1:44:59that okay so I want you guys to at least

1:45:02practice day one and come tomorrow

1:45:06else clear to

1:45:08everyone is this part clear to

1:45:13everyone

1:45:19yes try to write the code for the same

1:45:24okay whatever at least don't go and

1:45:27start writing your own code over there

1:45:29the first goal is whatever I have

1:45:31written write that part first by

1:45:33yourself

1:45:36okay up okay I'll have to first stop

1:45:40this meeting okay

1:45:43so the same solution will be uploaded uh

1:45:47in

1:45:48the

1:45:50LMS in the future

1:45:53in the LMS probably in the month of

1:45:55December or January or something like

1:45:57that this lecture I'll upload it in the

1:45:58zoom meeting and all okay in the zoom

1:46:00sections of the respective batches all

1:46:02right so other people can you can use it

1:46:04over there all right I'll discuss it in

1:46:07the in the LMS itself how to handle the

1:46:10SSL Sears and all we don't have that

1:46:11scenario right now

1:46:15right so if Sears and all those things

1:46:18comes into picture there's a you know

1:46:20like you have to have that connection

1:46:21like this is how you are supposed to

1:46:23pass it off and all those things I'll

1:46:25discuss that part later

1:46:29okay

1:46:32tired

1:46:37okay will you be able to explain these

1:46:39things practice it off but you make sure

1:46:41that you are able to answer it off for

1:46:44interview

1:46:51okay other people in the

1:46:54call is this part clear to everyone how

1:46:57many 60

1:46:5970%

1:47:04Perfect all right so this is something

1:47:07like the reason I had to take this

1:47:08particular stuff guys right now is um as

1:47:11I've said like start you need to keep on

1:47:13applying for interviews and all right so

1:47:15this is just the end to endend solution

1:47:17just like how I've done it for T it you

1:47:19practice this part over here okay

1:47:21probably this lecture will take a a

1:47:22little bit time to come in a different

1:47:25better quality on the LMS and all

1:47:27probably on the LMS I'll solve all the

1:47:29services okay and those things but for

1:47:33you guys to get started what are the

1:47:35various components of your API

1:47:36automization framework and all those

1:47:41things it's more than enough because

1:47:43here you are able to explain this thing

1:47:44off one more thing like

1:47:50uh I'm not using a Macbook yet I'm

1:47:58windows0

1:48:02days there's no hdle as such I I'll tell

1:48:05you what the only

1:48:07thing I don't know if most of the time I

1:48:10just tell people fake

1:48:16it though at least for certain

1:48:18interviews just so that you get that

1:48:21experience of giving the interviews now

1:48:23you start giving you know like you fake

1:48:26it off I'll be very honest solution you

1:48:29need okay even the reason is there's a

1:48:33lot of uh folks you know it's like uh

1:48:38Left Right coming into picture

1:48:52so 90 days you can say you're serving

1:48:55notice period I usually tell people tell

1:48:56them you're serving notice period you

1:48:58got an offer finish it off I I I to just

1:49:02I used to just say the same thing like

1:49:04tell the folks same himself and even if

1:49:06they ask you like show me the offer

1:49:08letter you're blun is supposed to say

1:49:10no Z they'll not take the interview as

1:49:13simple as that but at least the point

1:49:15that comes into picture is

1:49:18see these days uh when the market look

1:49:22look a little bit desperate and all

1:49:24those things but like there's too many

1:49:26people who are giving interviews and all

1:49:28you have your own stand K Baba this is

1:49:29my company Prof uh you know like this is

1:49:32professionalism that I cannot show the

1:49:35what do you call the offer letter and

1:49:36all unless you know like there's a

1:49:38tangible offer that I'm getting from you

1:49:40guys and first I'm not supposed to show

1:49:42it are you going to judge me on the

1:49:45salary offer that I'm getting or I'm I'm

1:49:47going to be judged on the knowledge that

1:49:49I'm having okay you have to say these

1:49:52things but

1:49:55I'm telling you this part yes Indian it

1:49:57Market is Indian what every it Market is

1:50:00like this only unless you know that this

1:50:03is what I deserve okay other people are

1:50:06not going to give it to you guys trust

1:50:08me on that personal life professional

1:50:12life this is going to be the same stuff

1:50:14Max to Max they'll only send this guy is

1:50:18taking you know

1:50:21like but I just just want to make sure

1:50:23that if I am giving the interview over

1:50:25there they should feel K Baba this

1:50:28person is always going to be an asset to

1:50:30the organization if he or she joins him

1:50:33okay so your major goal is to make sure

1:50:36that when you're giving the interviews

1:50:38you're you you know all the things in

1:50:41and out that's the reason build

1:50:48projects you sol this particular stuff

1:50:50you build it off show it off to them

1:50:52this is how like I can plan it off over

1:50:54there okay and always come like whenever

1:50:57you're answering any questions and

1:50:59interview you always say that this is

1:51:01the case study or this is a kind of

1:51:02scenario that you have faced in your

1:51:04office project as simple as that yeah

1:51:11yes

1:51:15yeah yeah recently got new job uhhuh and

1:51:19uh yeah I just went to the same process

1:51:22like

1:51:23I used to tell H that I'm serving notice

1:51:26I have offer and like the same thing I

1:51:29followed and first I took offer from TCS

1:51:32and then I resigned and after that like

1:51:35I kept telling the HR that I have only

1:51:38one month notice period so like

1:51:40interviews were lined up because of that

1:51:43and ultimately I had like many offers in

1:51:46hand that's only joined recently which

1:51:49company you joined recently now H works

1:51:53sorry thought works okay thought thought

1:51:56works yeah oh okay okay thought works

1:51:58good good okay someon I don't know VW

1:52:01work popped up into my

1:52:04thought okay that's nice yeah all life

1:52:07is good over there on side cut right but

1:52:10I this is one benefit I like to sorry

1:52:13just to cut people off over here just

1:52:15remember one thing guys you know like

1:52:16people hate me for saying that part but

1:52:19keep on changing the job after one year

1:52:21unless you are doing that that part

1:52:23there is no way you know you will you

1:52:27will reach the level you want over there

1:52:29some people like I want to stay in a

1:52:31company for two three years nothing

1:52:32inflation is rising bro

1:52:36so so make sure even if they say that

1:52:40the hike is going to be good or

1:52:41something like that unless this is this

1:52:44is this is the thing which I tell to

1:52:45most of the folks unless they're telling

1:52:47you guys to that you are going onsite or

1:52:49you know like um you are getting a

1:52:52better increment or

1:52:56something 50% to minimum salary right so

1:53:00it doesn't make sense to stay over there

1:53:02yeah what are you saying

1:53:05SW yeah actually and they have like

1:53:07that's why I asked like I saw you you

1:53:10open Notes uh in between of the class so

1:53:13I thought you are also using MacBook so

1:53:14they have given MacBook and I I'm not

1:53:17able to use it at all

1:53:24so this is just the notion app so you

1:53:26can like just the place where I've kept

1:53:28the notes for you guys

1:53:36okay okay any other questions

1:53:39guys uh do share me the question swap

1:53:41whatever they have asked you just

1:53:43WhatsApp me those

1:53:44things okay and do we need to create

1:53:48account on the swift. with Swift yeah

1:53:52you can do that part there's nothing as

1:53:54such like you can use your own

1:53:55credentials previously in Phoenix I used

1:53:57to give the credentials over here you

1:54:00can create your own account okay you can

1:54:02handle those things off by yourself okay

1:54:05that's something that you can take care

1:54:08yeah

1:54:12okay any other questions guys

1:54:22Monica did I gave you the end to end

1:54:24solution for the API I thought you you

1:54:27did not join today yeah yes it is very

1:54:31useful so I'll you have to practice the

1:54:34to tomorrow I'll give the project to you

1:54:36guys I'll tell the folks to you know

1:54:38like create a one shot big lecture only

1:54:40and give it to you guys so you can use

1:54:41it over there okay so make sure you guys

1:54:45you practice this particular stuff

1:54:46whatever we have built over

1:54:49there that's the only thing I can see on

1:54:52this

1:54:53I can just build it once and I can show

1:54:54it over there but the point is um

1:54:57tomorrow's class I will wrap up with the

1:54:59user management system change password

1:55:02profile and all those things okay the

1:55:04different HTTP verbs so all these

1:55:06methods will be created in the base

1:55:08service layer I'll create the user

1:55:10management okay and

1:55:14um I think looking at what we need to do

1:55:18I need one more lecture probably on next

1:55:21Saturday I'll update you on that part

1:55:24guarante I Because unless I don't want

1:55:27to push it off to the next level so

1:55:29we'll stop over here for today guys uh

1:55:31this lecture I'll put it in most of all

1:55:33the batches okay and I'll tell these

1:55:35guys to create one combined lecture and

1:55:37it will be there in the salpas

1:55:39section please you have the notes okay

1:55:43so try to practice it off tomorrow okay

1:55:46so that's something that you guys can do

1:55:48it at your end all right

1:55:52okay

1:55:54paru long time no see all

1:56:03good okay uh J uh Have you shared the uh

1:56:08Have you shared this Swagger link sorry

1:56:11I missed that there's the first link in

1:56:13the document if you go up all the way

1:56:16up yeah yeah right yeah okay yeah thank

1:56:19you take care bye-bye all right guys

1:56:22take care thank you so much good night

1:56:24take care

1:56:29bye-bye

1:56:31the today's class this is going to be

1:56:35the second part

1:56:37uh I wanted to complete the entire

1:56:39framework for today but then there was a

1:56:41request that they wanted um end to end

1:56:44flow so what I'm going to do for today

1:56:47is I'll write the test scripts little

1:56:50bit test scripts I'll write it off for

1:56:51you guys uh for one flow so you

1:56:54understand how it's going to work the

1:56:55listener And all I'll try to implement

1:56:57it in the next class okay so next

1:57:00Saturday also there will be a session

1:57:02the link will be SE okay so that's the

1:57:06only thing that I wanted to give a quick

1:57:08update

1:57:09on uh yeah yes message

1:57:14delete else what happens is people will

1:57:17think the class did not start okay oh

1:57:20sorry okay so let me just um share the

1:57:46screen let me know if you're able to see

1:57:48the screen right now okay I'm I'll

1:57:51probably be using this particular

1:57:52document itself uh Theory I think so you

1:57:55guys can read it off over there there's

1:57:56nothing fancy about that stuff not

1:57:58something major I have added it off uh

1:58:01we were able to complete yesterday only

1:58:04tell authorization service and all uh

1:58:07day two uh day two yeah day two I've

1:58:10just changed it off the thing which was

1:58:11required for day three I moved it at the

1:58:14end now so I'll just focus over here

1:58:16I'll parall be updating this particular

1:58:19documentation there's some spelling

1:58:20mistake which I need to fix I'll do

1:58:22those things now this is the flow of the

1:58:24application just the state diagram that

1:58:27I've given over here first the user logs

1:58:30in into the application that is it is he

1:58:33or she is going to be using the

1:58:36authentication Service so let's say the

1:58:40user decides K Baba I will be doing

1:58:42login so he or she is going to use the

1:58:47login

1:58:48API once he or like once they use the

1:58:52login API they will be logged in into

1:58:54the application and from there they can

1:58:57go to the profile management they can

1:58:59change the password they can get the

1:59:01profile details they can update the

1:59:03profile details you know so on and so

1:59:06forth similarly authentication Service

1:59:09has different option if I'm trying to

1:59:11sign up into the application let's say

1:59:13my account gets created I'll again use

1:59:15the sign up and the moment I sign up I

1:59:18will be able to log into the application

1:59:20and then I'll be able to use the profile

1:59:22file management service if I'm saying

1:59:25forgot password what happens in forgot

1:59:27password I will be using the forgot

1:59:29password API it is going to send a

1:59:33email uh to your inbox and from there I

1:59:37have to reset I have to click on the

1:59:39link and it will reset the password

1:59:41generally that what that's what happens

1:59:42for security purpose so when you look at

1:59:47authentication Service there are 1 2 3

1:59:50four four ENT points or four uh actions

1:59:54or operations that can be done okay and

1:59:57when you look at project profile

1:59:59management you can delete the account

2:00:01you can update the details okay one API

2:00:04name got deleted over here this is going

2:00:06to be uh modifications that you can use

2:00:09in your account so for example let's say

2:00:13if I decide to go to this particular

2:00:15application

2:00:17um yeah my voice is breaking we'll fix

2:00:20it right away I start started

2:00:23the just minute I started the extension

2:00:27but I did not connect to

2:00:48it it should not break now all good yes

2:00:52is my voice breaking now

2:00:57no as of now good oh good

2:01:01that's all right cool so over here let's

2:01:06say uh this is the logged in user if I

2:01:09try to click on sign in I forgot my

2:01:12password I think I updated the password

2:01:141 2 3

2:01:154

2:01:19five 1 2 3 4 five

2:01:22bad credentials anyways um I'll just

2:01:25reset the password in front front of you

2:01:27guys so this is a normal scenario I

2:01:28forgot my password so uh technically I

2:01:31will be going to the forgot password

2:01:34option where I need to give my email

2:01:39address please be on mute yeah so over

2:01:43here um over here I have to give the

2:01:45email address for this particular

2:01:47account I did change the email address

2:01:49so let's say if I go to this particular

2:01:50account and I go to

2:01:55Gmail uh let's select this particular

2:02:01account

2:02:03okay I am going to enter the email ID

2:02:06over here and I'm going to click on send

2:02:07instructions now if I'm not wrong there

2:02:11is a link which is there yeah you see an

2:02:13error message popping up into picture

2:02:15now over here the reason I'm getting

2:02:17this error message because there is

2:02:19already a link which is sent to my

2:02:22account at

2:02:23908 okay that please use this particular

2:02:26link to update the password so I'm going

2:02:28to just click on this link and I'm going

2:02:30to give the new password over here so

2:02:32let's say the new password is going to

2:02:33be uh temp 1 2 3

2:02:374 let's keep it udai only UD 1 2 3 4 UD

2:02:421 2 3 4 let's click on reset the

2:02:44password the password has been updated

2:02:47okay so this is one of the flow let's

2:02:50say if the user was has forgotten the

2:02:53password he is just going to go to the

2:02:55forgot password

2:02:57option I'll just take away this option

2:03:00of muting yourself mute

2:03:04all and

2:03:09uh

2:03:11perfect okay you you won't be able to

2:03:13unmute yourself just put the questions

2:03:14in the chat box so over here guys um now

2:03:19that my account password has been

2:03:21updated it okay if I try to enter this

2:03:24thing

2:03:25UD 1 2 3 4 I should be able to log in

2:03:28into the application is this part clear

2:03:30to everyone nothing fancy just the

2:03:33normal flow how you do it off all the

2:03:35time that you're you forgot the password

2:03:37you click on the forgot password and

2:03:39then the email was sent to the user

2:03:41account and from there you have updated

2:03:43the password all right this is something

2:03:45normal we do all the time now over here

2:03:48once the user logs in you see

2:03:52I did a forgot password my password was

2:03:55updated I came back over here I did a

2:03:58sign in and now I am in the dashboard

2:04:01page so when I go to this particular

2:04:04dashboard page right now what you'll

2:04:06observe there are multiple Services each

2:04:09tab over here is a different service

2:04:11okay so out of this thing my major focus

2:04:14is on profile so when I go to profile I

2:04:17can do a lot of things over here that is

2:04:20I can update the username okay I can

2:04:24update my email address so the email

2:04:26address right now is this I can update

2:04:28my mobile number as well as I can update

2:04:31or change my um

2:04:35address okay along with that uh there

2:04:39are few other apis which are not being

2:04:42shown on the

2:04:44UI like if I want to delete my account I

2:04:47cannot delete it from here but I have

2:04:50created a service I have created an endo

2:04:54in the user management where the user

2:04:57can be

2:04:58deleted is this part clear to everyone

2:05:01so you can change the password okay so

2:05:05if I go to change password this is this

2:05:07is the one which comes into picture this

2:05:09change password I can give a I have to

2:05:12enter my current password and I will be

2:05:15able I just can give a new password over

2:05:17here okay so this is the change password

2:05:20API that we we have then you can get the

2:05:24profile details so if I go to the

2:05:27profile section name email mobile number

2:05:32address whatever it is these are the

2:05:34things which are coming because of the

2:05:37get profile details make sense to

2:05:40everyone put profile I want to edit the

2:05:43profile edit Click mobile number change

2:05:46I give a different number over here

2:05:47let's say 9869 237 627 and I click on

2:05:53Save the changes the profile details are

2:05:55getting updated okay I can change the

2:05:58name if I'm required so all these things

2:06:01this is the profile user Management

2:06:03Service which is there clear to

2:06:06everyone is this part clear to everyone

2:06:08what are the things which are there

2:06:11okay apart from that I probably want to

2:06:14create an account let's yesterday people

2:06:17were telling

2:06:20meem don't have an account sign up okay

2:06:23so click over here you can create an

2:06:25account so when I'm trying to enter

2:06:28username email address password confirm

2:06:31password okay and I enter my personal

2:06:33details then in your

2:06:36authentication your sign up API will be

2:06:39called because sign up API requires all

2:06:41these things username password email

2:06:44first name last name mobile number is

2:06:47this part clear to

2:06:49everyone

2:06:50section you create or you use this sign

2:06:54up API coming into picture now it

2:06:56totally depends on the flow of the

2:06:58application what do you want like what

2:07:00kind of a service you are trying to

2:07:02create so let's say my manager says Baba

2:07:08or let's say there is a requirement he

2:07:10you need to check the complete

2:07:12authentication Service we'll go step by

2:07:15step rather than see when you're testing

2:07:18apis now end to end flow

2:07:24SE okay so if I want to go to that

2:07:29particular State diagram that I want

2:07:30something all these things to come into

2:07:32picture you just make sure that you have

2:07:34everything about authentication Service

2:07:36tested so individually I can check

2:07:39whether the authentication is working

2:07:41correctly or not are you getting the

2:07:43point then I will have another uh

2:07:47section for profile Management Service

2:07:49so all the apis which are going to

2:07:51related to profile management I'll be

2:07:53testing that and then I will be

2:07:55connecting them together makes sense to

2:07:58everyone simple because then I can just

2:08:00create uh objects and I just need to

2:08:02call those methods is this part clear so

2:08:06what we will do first is we will go back

2:08:09to the

2:08:11application uh that we have created over

2:08:13here and uh step by step we'll start it

2:08:17off don't look over here this is

2:08:19something which I was trying it off for

2:08:20today let's close all the

2:08:22tabs close

2:08:24all and we were having this demo API

2:08:27automation framework if I go to this SRC

2:08:30test yesterday we created the O service

2:08:33of a service May there are few things

2:08:35that we have done a service extends the

2:08:38base service if I ask you what is the

2:08:40purpose of Base Service Base Service is

2:08:42just a wrapper over rest assured so all

2:08:44your rest assured methods are popping up

2:08:46over here and that is something that I

2:08:48can use it off now uh whether I want to

2:08:52make post request whether I want to make

2:08:54your put request your get request for

2:08:56upes I will be taking care it over here

2:08:58only as simple as that okay now

2:09:03yesterday someone had asked me that okay

2:09:05the base URL is something if it's going

2:09:07to be different how I'm going to do it

2:09:09off but let's just focus on this

2:09:12particular application so given in the

2:09:15Constructor only I'm just going to say

2:09:17set the base URI and I can just give the

2:09:19base URL whatever is the URL of the app

2:09:21application so I don't want to use this

2:09:24particular method I have just overloaded

2:09:26it if you want you can use it off but I

2:09:28won't be using this um now I will not

2:09:33come to the base service class unless

2:09:35there is a

2:09:37requirement because if I go to the um

2:09:41Swagger

2:09:43UI the authentication only takes care of

2:09:46post there's only post HTTP Verve so I

2:09:50have already taken care of for post as

2:09:52simple as that so I will not modify the

2:09:56base service unless there is going to be

2:10:00a get put delete HTTP verbs popping up

2:10:03into picture is this part clear to

2:10:06everyone when there is a requirement for

2:10:08making a different API request that time

2:10:11you will be making changes in the base

2:10:13service class is this part clear can I

2:10:15go ahead okay yes

2:10:18no perfect now what what we need to do

2:10:22in this

2:10:23scenario what we need to do in this

2:10:25scenario over here is we are going to go

2:10:28to the O service and in authentication

2:10:31Service yesterday we introduced login

2:10:34but now I want to go for something else

2:10:36I want to go for let's say sign up this

2:10:39is the thing which I want to test as

2:10:42simple as that check he signup API is

2:10:47working correctly or not so what I need

2:10:51to do we'll go step by step the first

2:10:54thing is over here in the

2:10:58login sorry in the OD service I will

2:11:01create a method and I will call this

2:11:04particular method as sign up because

2:11:08that is the name of the endpoint sign up

2:11:12endpoint right now the payload of sign

2:11:16up if you look at the payload of sign up

2:11:19that is sign sign up request payload the

2:11:24username is there password is there

2:11:25email is there first name is there last

2:11:27name is there mobile number is there so

2:11:29what I need to do for this chap I need

2:11:32to create a what model right we need to

2:11:35create a model over here so how we can

2:11:38create it off just copy this

2:11:41thing okay I'm going to go back to your

2:11:44framework we have to go to the com. API

2:11:47model. request because we are handling

2:11:50the request right now and over here I

2:11:53will be creating a new new model for the

2:11:57request and I'm going to call this as

2:11:59sign up

2:12:03request

2:12:04okay up this is what I want to introduce

2:12:08quickly we'll create a pojo class out of

2:12:10it control F okay find me a double code

2:12:15replace it with nothing replace all find

2:12:18me a colon uh replace it with a

2:12:20semicolon replace

2:12:24all

2:12:28okay once you get comfortable with all

2:12:30these things now you can use your chat

2:12:32GPT and all those things I generally

2:12:35don't like to use it in the class

2:12:39s you need to understand how and why you

2:12:42are creating it first because then um in

2:12:45coming years it's just going to be copy

2:12:47paste copy paste and you just need to

2:12:49make sure that these things gets created

2:12:51quickly all right so now what I want to

2:12:55do is I want to make sure that these are

2:12:57going to be instance variable and when

2:12:59I'm saying that this is going to be

2:13:00instance variable they will be marked as

2:13:03nonstatic that is static keyword will

2:13:06not be there and it is going to be

2:13:08this okay so I'm going to copy this

2:13:12chap paste it over here here here here

2:13:16now what do I want in life I want to

2:13:18create this as a hjo class so I'm just

2:13:21going to right click go to say and

2:13:22generate a Constructor using the fields

2:13:25right click go to Source generate

2:13:27Getters and Setters select

2:13:30all generate right click Source generate

2:13:34the two string

2:13:36method is there anything that you did

2:13:38not understand what I've done over here

2:13:40why did I create sign up request is this

2:13:43part clear to everyone over

2:13:46here

2:13:49yes okay

2:13:52everyone is the same thing the story

2:13:55Remains the Same change story okay I

2:13:58created the same story in the Ted when

2:14:00we wanted to create pojo classes I

2:14:01created it over here but today let's do

2:14:05something different

2:14:06also I want to introduce something which

2:14:09is called as a builder design pattern in

2:14:10this

2:14:11scenario now over here if you look

2:14:14carefully parameters username password

2:14:17email first name last name mobile number

2:14:21and if You observe sometimes when I'm

2:14:24creating the object I forget what was

2:14:27the parameter one what was the parameter

2:14:30to I make mistakes right and it happens

2:14:33with you also because then you think

2:14:35start thinking username username was

2:14:38coming as first field second field third

2:14:39field are you getting the point this is

2:14:41a very known issue that is happens with

2:14:43everyone because if you are giving a lot

2:14:46of parameters to your Constructor you

2:14:48will always forget Baba username

2:14:51position 1 2 3 4 right so this problem

2:14:55can easily be solved using a design

2:14:59pattern which is called as a builder

2:15:01design pattern okay now Builder design

2:15:06pattern basically is a a special way of

2:15:09creating a class and this particular

2:15:12class basically helps

2:15:14you to make sure that you

2:15:19are able to assign the values in any

2:15:23order but I can pass mobile number first

2:15:28then I can pass email second then I can

2:15:30pass name third so on and so forth

2:15:33something that we have done during the

2:15:35initial uh stage of the script this

2:15:39given base URI dohe header body so and

2:15:42so forth so this is basically your

2:15:44Builder design pattern and this is

2:15:46something that I want to implement into

2:15:49my automation framework

2:15:51okay this is just for the practice

2:15:53purpose so that you know like if in

2:15:55interview they ask you the question uh

2:15:57tell me the different design patterns

2:15:59that you have created in your automation

2:16:01framework I know you will be able to

2:16:03talk about page object you will be able

2:16:05to talk about Factory design pattern you

2:16:07I hope you will be able to talk about

2:16:09service design pattern that we have seen

2:16:11so far and the most important thing over

2:16:15here I hope you will be able to now talk

2:16:18about the fact uh your uh build build a

2:16:21design pattern also just give me a

2:16:22moment over

2:16:25here now over here when you're are

2:16:28looking at creating the Builder design

2:16:31pattern Builder design pattern basically

2:16:34is actually inner class I don't know if

2:16:37you remember what exactly inner classes

2:16:40in Java okay we'll talk about inner

2:16:43classes over here a class inside a class

2:16:46is basically what you call as inner

2:16:48class can I have a class in inside

2:16:51another class the answer is yes this is

2:16:54my class called sign up request class

2:16:58class B okay and that class is

2:17:02apparently going to become my inner

2:17:05class now there is a rule about inner

2:17:08class which classes in Java can be inner

2:17:12class static class so the next question

2:17:15that comes into picture Jan can you make

2:17:17a class as static the answer is yes we

2:17:19can make a class as static and in which

2:17:24scenario you will be making the class as

2:17:26static the answer is in front of

2:17:28you Builder design pattern when I want

2:17:31to implement Builder design

2:17:37pattern I created a class inside a class

2:17:40yes or no and this class is static in

2:17:42nature first

2:17:45rule inst

2:17:48Vari copy all the instance variable put

2:17:51it inside this particular class is this

2:17:53part clear to everyone what I've done so

2:17:55far I created a class and inside this

2:17:58particular class I created another class

2:18:00which is static in nature and this

2:18:02particular class has all the instance

2:18:04variable whatever is there over here

2:18:08okay class Constructor this particular

2:18:11class builder class is not going to have

2:18:13Constructor inside it then what is will

2:18:16be there what will be there just the

2:18:18methods I'm going to create a meod in

2:18:21front of you public

2:18:24void I'll say

2:18:27username public void username you are

2:18:29going to give the

2:18:32username and then I'm going to say this

2:18:35do username equal to

2:18:38username have you seen this script

2:18:40anywhere when you write this. username

2:18:42equal to username this is your

2:18:45seter this is your Setter yes or

2:18:49no yes no

2:18:51set not get set because you setting the

2:18:56value Builder design pattern does not

2:18:59have any return type uh does not use

2:19:01void as a return type I always said void

2:19:03is not never a good return type so over

2:19:06here once I will set this

2:19:09thing once I will set this

2:19:12thing I'm going to return the current

2:19:17object is class be current object the

2:19:21the the programmer is using I will be

2:19:23returning

2:19:25that

2:19:27now how do I get the current object of

2:19:30the

2:19:32class how do I get the current object of

2:19:34the class plus this

2:19:37keyword that was the thing which I

2:19:39uploaded a couple of days back this

2:19:42keyword this is going to return me the

2:19:45current object for you guys I'll write

2:19:48it in a little bit different step

2:19:51this means current

2:19:54object object

2:19:56means new

2:19:59Builder I'll writing it in front of you

2:20:01like this if I'm going to create a

2:20:04builder object and X is going to be my

2:20:07reference variable what will be the data

2:20:09type of X what will be the data type of

2:20:12X you will say

2:20:13Builder because of current object return

2:20:16you creating an object of Builder and X

2:20:19is going to be the reference f variable

2:20:21I say return

2:20:22x what will be the return type of this

2:20:25method now what this method is going to

2:20:28return

2:20:29me what will be the return type of this

2:20:31method now

2:20:35Builder data type of X will be the

2:20:37return type is this part clear to

2:20:39everyone what I've written over

2:20:42here yes no everyone can I go ahead but

2:20:47when I when I wrote over your new

2:20:49Builder up current

2:20:52object you said Java go and create a new

2:20:56object it is not talking about the

2:20:59current object you said go and create a

2:21:01new object what happens when you write

2:21:03new Builder class will be loaded into

2:21:04the memory instance variable will be

2:21:06created Constructor will be called I

2:21:09don't want to create an object I want

2:21:11the current object to be

2:21:14there so this basically gives me the

2:21:17current

2:21:18object I can either it like this it will

2:21:21still work or what I can do is I am

2:21:25going to create another way okay I'm

2:21:29just going to say password you will give

2:21:31me the

2:21:33password

2:21:35password either either and instead of

2:21:38writing all these things I will just say

2:21:40return this

2:21:42finish makes sense to everyone choice is

2:21:44yours start slow but then pick up to the

2:21:47next mode what exactly this line

2:21:50technically signifies is this part clear

2:21:52to everyone now what I've written yes no

2:21:56perfect both the two methods username

2:21:58and password method is clear to everyone

2:22:00technically it is the setter only set

2:22:03password

2:22:05password okay I've just written this now

2:22:10what we will do is I will take

2:22:12this to 3

2:22:164 now just take email username and

2:22:20password word is done email email email

2:22:23email this is my set email method okay

2:22:27first name first name first name first

2:22:30name first name then last name method

2:22:33last name last name last name last name

2:22:37done mobile number is left take this

2:22:41okay paste it I'm going to say mobile

2:22:45number okay mobile number mobile number

2:22:48oops mobile number Mobile number

2:22:51is this part created to everyone what

2:22:53I've done so far I created a builder

2:22:55class which has the same instance

2:22:57variable which is there in your sign up

2:23:00request class builder design pattern

2:23:03Builder class so take the sign up

2:23:05request whatever the instance variable

2:23:07are there take that put that in the

2:23:09inner class okay the static class and

2:23:14for each instance variable I have the

2:23:16respective methods okay it is going to

2:23:18set that instance variable and return

2:23:20the current

2:23:23object clear to everyone clear to

2:23:27everyone is the job done over here the

2:23:29answer is no once everything is done I

2:23:32will be creating a method called as

2:23:36build and what build is going to do

2:23:38observe it is going to create the object

2:23:41of sign up

2:23:47request done

2:23:56now what did I say about Builder design

2:23:59pattern in Builder design pattern the

2:24:01methods will always return

2:24:05something methods will always return

2:24:09something so over here in the build

2:24:13method also I will be returning the sign

2:24:16up request object so this is what is

2:24:18going to be there

2:24:20okay done so I created a class the this

2:24:26is just a pojo class but it also

2:24:29implements Builder design

2:24:33pattern every time he build something

2:24:35new so the benefit that you are getting

2:24:38when you write something like

2:24:40this is uh let's say this is use account

2:24:47creation

2:24:48test okay and and let's take this

2:24:51particular method only as a reference

2:24:53copy

2:24:57this public void create account

2:25:05test okay over here what we want

2:25:14is just give me a moment

2:25:22over here what we want is I want to

2:25:26create an account so if I want to create

2:25:30an account

2:25:32payLo of course I can just call the

2:25:34service okay service all service equal

2:25:38to new OD service okay and I can say OD

2:25:42service. create account if that method

2:25:44is there sign up okay but the thing is

2:25:50the payload that I have to give is going

2:25:52to be of sign up

2:25:54request yes or no sign up request

2:25:57payLo so I need to create the sign up uh

2:26:01pojo object okay so one thing I can do

2:26:06is I can write something like

2:26:09this okay or

2:26:12pass so right now I was having username

2:26:14password email first name last name

2:26:17mobile number but if your payload is

2:26:19going to be big let's say you have 30 40

2:26:21fields which are there 30 40 10 15

2:26:24fields which are there the Constructor

2:26:26is going to look very complicated over

2:26:28there so what we do in this kind of

2:26:31scenario we use

2:26:33Builder sign up

2:26:36request sign up request has a class

2:26:39inside it h enough sign up request has a

2:26:43class inside it yes or

2:26:46no sign up request class yes no what is

2:26:50the nature of that class it is a normal

2:26:53class or it is a static

2:26:55class static class so if you have a

2:26:59static variable do you create an object

2:27:02to access that variable no we just need

2:27:05the class name if I am going to have a

2:27:09static method do I need to create an

2:27:11object no class name is enough so the

2:27:15same way if a class is having another

2:27:17class inside it and that class by de

2:27:20friends and that class my dear friends

2:27:23is actually a static

2:27:29class I can just say sign up do

2:27:34Builder sign up dot Builder

2:27:38dot dot what do you want I want to set

2:27:41the

2:27:42username okay I want to use the username

2:27:46first so I can just say dot username why

2:27:48it's giving me user name like this just

2:27:51a

2:27:53moment yeah it should be the object over

2:27:56here my

2:27:57bad now it will pop up

2:28:01username new signup

2:28:04request. Builder do

2:28:08Builder I will set the username first

2:28:12usern I'm going to say

2:28:15this

2:28:17okay usern return what does username

2:28:21returns me what does username returns

2:28:25me

2:28:27Builder it returns you Builder now the

2:28:30return type of username method is what

2:28:32Builder it returns you the current

2:28:34object is he current

2:28:36object see current object I'm just going

2:28:39to say

2:28:40dot I want to attach let's say

2:28:44email what is your email address disha

2:28:48atate yahoo.

2:28:54to this particular current

2:28:56object I want to attach first

2:29:00name

2:29:04okay I'll say thisa let's say the

2:29:07username I give a different number 1 2

2:29:093 to the current object that we have

2:29:12first name also returns me Builder I can

2:29:15say attach password

2:29:20I'll put it off over there say say thisa

2:29:221 2 3 4 or 1 2 3 this also I'm going to

2:29:25keep it simple for my for me then I'm

2:29:29going to

2:29:30say dot this uh dot last

2:29:34name okay I'll say

2:29:38but dot mobile

2:29:41number

2:29:43777777

2:29:467 1 2 3 4 what's the

2:29:51number 1 2 3 4

2:29:565 okay for

2:29:59safety and once you have used all the

2:30:03instance variable like you have done the

2:30:05setting what is the last method that I'm

2:30:08supposed to

2:30:09call what will be the last method method

2:30:11use method which is that

2:30:13method the build

2:30:16method now what does build method

2:30:18returns you

2:30:20build method returns me the sign up

2:30:22request it is going to internally create

2:30:24that object of sign up request

2:30:28okay and this entire stuff will create

2:30:31it like

2:30:45this

2:30:47finish this is your Builder design

2:30:49pattern

2:30:51o is this part clear to

2:30:54everyone

2:30:59simple is this part clear to

2:31:02everyone in interview they can ask the

2:31:04question what is the benefit of this

2:31:07benefit

2:31:12is are you getting the

2:31:15point you could have done it with the

2:31:17Constructor but the thing with the

2:31:18Constructor you have to remember the

2:31:19parameter

2:31:21what whatever works for

2:31:23you then I have to remember the

2:31:26parameters but as I've said if you're

2:31:28going to have multiple parameters if

2:31:30you're going to have a lot of parameters

2:31:3210 15 your Constructor length is going

2:31:34to be pretty big Mak sense this becomes

2:31:38easy for you to read it username is

2:31:41thisha email is this first name is this

2:31:43password is this last name is this

2:31:45mobile number is this and then you say

2:31:46build and give me the object of sign up

2:31:48request okay and then attach it off over

2:31:53here

2:31:56okay

2:31:58everyone can I get an input from you

2:32:01guys yes

2:32:09no then you're done what does sign up

2:32:12request returns you guys sign up request

2:32:14returns be your

2:32:16response and this is where my response

2:32:18comes out to picture

2:32:23and I will say sis

2:32:27out

2:32:33response I have to check what would work

2:32:36what will not

2:32:38work but it fails API authentication log

2:32:42that's the Endo mistake I made path is

2:32:45API o login so over here let's go to

2:32:48sign up and we need to fix this path

2:32:50okay that is just uh you know like my

2:32:54silly mistakes that I always make all

2:32:56the time I'm just going to copy this

2:32:57it's uh just change it over here life is

2:33:00good okay it's just going to be sign up

2:33:06okay

2:33:09copy paste it and uh I can run this part

2:33:13and if I hope it works now

2:33:19okay what do you see the message over

2:33:22here user registered

2:33:26successfully you want to write the

2:33:29test all you will need to say

2:33:34is

2:33:35assert do assert

2:33:40equals response do as pretty string

2:33:57you will be like Artin you did not

2:33:58create an object for you know like a

2:34:01pojo object for this I don't need to

2:34:03create an object for this and the reason

2:34:06for that uh guys is because this is a

2:34:10normal string that I'm getting back in

2:34:14response I'm getting a on line

2:34:16description back normal text message

2:34:20okay simple text so that's the reason

2:34:22it's a simple string which is printed

2:34:24and I'm just checking the string values

2:34:27they are equal or not is this part

2:34:30clear is this part clear to

2:34:34everyone if I save it up test pass so

2:34:38you don't need object creation for this

2:34:40test works completely

2:34:42fine

2:34:44okay so if you start observing the

2:34:47benefit that I'm getting with the design

2:34:49design patterns and the structure that

2:34:51we have

2:34:52created I not using rest assur anymore

2:34:55did I go to the base service class and I

2:34:57did I did I make any kind of a

2:34:58modification over there

2:35:01no

2:35:04service I introduced this method my job

2:35:07is done just change the sign up to

2:35:10payload whatever the payload I need to

2:35:12pass base path I already know I just

2:35:14gave the end point and even if I am

2:35:17trying to write your test this is pure

2:35:21Java nothing else do you see any for

2:35:24Loop do you see any conditional

2:35:25statement ni see the object B

2:35:28pass okay created the object called the

2:35:32method got the data done my job is done

2:35:36make sense is this part making sense to

2:35:39everyone so this becomes better in terms

2:35:44of Maintenance what people were writing

2:35:47before

2:35:51what

2:35:53M so maintenance is pretty high in this

2:35:56scenarios but over here like in all

2:35:58these things maintenance is pretty high

2:36:01but what we have written over is pretty

2:36:03simple tomorrow you say check the status

2:36:05code simple just go over here change it

2:36:07to response do status code what do you

2:36:11want 200 just change this to 200 and we

2:36:14are

2:36:15done save it run it output is still the

2:36:18same

2:36:20I did not understand the function of

2:36:22Builder method the request. Builder is

2:36:26basically if I have to create if you

2:36:28look carefully this is a static class

2:36:30right so if I have to access the static

2:36:33class I have to access it like

2:36:35this getting the

2:36:37point OBC sign up new request is equal

2:36:41to new sign up request you have to first

2:36:43create the object from that stuff I am

2:36:46trying to access the Builder object and

2:36:50then for that Builder object I'll keep

2:36:52on passing username email first name

2:36:55okay password last name any order

2:36:57whatever you want okay sorry I forgot

2:37:00did you pass the authorization token

2:37:02somewhere why would you pass an

2:37:03authorization token by

2:37:05account do you need an authorization

2:37:08token before you create an account or

2:37:10what you need authorization token when

2:37:11you try to access the services after you

2:37:14have logged in this is sign up account

2:37:18creation make sense

2:37:25everyone account

2:37:32creation

2:37:35okay other

2:37:37people make sense to

2:37:42everyone now uh I'll go with uh another

2:37:46flow just a simple one I'll go for

2:37:48forgot password

2:37:51now the reason I'm taking this forgot

2:37:53password is just so that you can

2:37:55understand another way of passing the

2:37:56data or P data pass to

2:38:00your your request body I'll show you

2:38:04another way now look at this particular

2:38:06stuff and you guys start telling me I'll

2:38:08take this one very slowly I have been

2:38:11given to test this API call forward

2:38:14password where should I make start

2:38:16making changes should I make change in

2:38:18the base URI sorry Base Service is there

2:38:21anything that I need to change in the

2:38:22base service post request is there okay

2:38:27I have already created a method for

2:38:29handling the post request so nothing

2:38:31needs to be changed in the base

2:38:33service authentication Service May there

2:38:35is a new method new API coming into

2:38:38picture forgot password so I can know

2:38:41that I have to create a new method in

2:38:43the OD service

2:38:45class now I can see that it requires

2:38:49a payload a payload this is just a one

2:38:56field yes or no there is only one field

2:38:59inside this

2:39:01particular

2:39:03payload so I can create a class but

2:39:08should I create the

2:39:11classi I you can create it off but we'll

2:39:15go with a short solution for this if you

2:39:18want Baba your payload is only going to

2:39:21have one

2:39:22key okay you don't really need to create

2:39:25a class you can go for a different

2:39:27approach in this scenario so what we

2:39:30will do is we'll go to the O

2:39:33service and we will introduce a new

2:39:36method as usual because that's what we

2:39:38want all the methods in the all service

2:39:41will always return response because API

2:39:44calls okay so response will come into

2:39:46picture and the name of that API I will

2:39:49what is this forgot

2:39:52okay

2:39:54password forgot password Emil to you

2:39:58will be giving me directly the email

2:39:59address for the first time I am not

2:40:03passing any pojo I say give me the email

2:40:06address directly email address why I'll

2:40:09explain you I have to make the post

2:40:14request so

2:40:17this is what I will be passing over here

2:40:19in a moment but in a different way

2:40:23now

2:40:25before I do that I'll take this forgot

2:40:28password

2:40:34endpoint and I'll put it over

2:40:38here up the magic is going to happen K

2:40:41Baba you will be giving me the email

2:40:42address in double quotes disab B1 123 at

2:40:47the yahoo.com all those will come over

2:40:50there but I need to create a payload so

2:40:53we go with a different solution over

2:40:55here we will create a key

2:40:58value we will create a key

2:41:02value in a in Java ecosystem is there a

2:41:05data structure that can handle key

2:41:08value

2:41:09maps map is a data structure that can

2:41:12handle key value values key value pair

2:41:14of data so I'm going to create a hashmap

2:41:17in which key will be string and value

2:41:20will be string and I'm going to call

2:41:22this chap as

2:41:24payload there go and I'm going to say

2:41:26equal to new

2:41:28hashmap hashmap is a

2:41:30class which takes key value kind of a

2:41:33data that reference is called as payload

2:41:36and I've created an object of

2:41:40hashmap I'm just going to say payload do

2:41:44put put is the method not HTTP we if I

2:41:47have to put something in the hashmap I

2:41:48have to use put

2:41:49method I'm just going to say

2:41:54email because the key is email and value

2:41:57is what you will give me kutam

2:41:59finish okay this is what I've introduced

2:42:02over

2:42:05here

2:42:13test forgot password test

2:42:34I need to test the forgot password you

2:42:36guys know it we know it it belongs to OD

2:42:39service service object service service

2:42:42is equal to new OD service all service.

2:42:45forgot password give me the email

2:42:47address now I'll take the email address

2:42:49which I have this one okay so going to

2:42:55copy this email address paste it over

2:43:01here okay forgot password returns you

2:43:05response store it inside the response

2:43:09variable and I'm going to say

2:43:11system.out.println

2:43:13response. as D string save it run it

2:43:17let's see if it works

2:43:28message if your email exist in a system

2:43:31you will receive the

2:43:33instructions password request for 1024

2:43:37at my end this is the

2:43:39link is this part clear to

2:43:42everyone what do you understood over

2:43:44here like Baba if there is going to be

2:43:46only one field a field

2:43:50field just email I need to put over

2:43:52there don't go and start creating your

2:43:54page class or sorry pojo class model I

2:43:57can easily handle it off with my hashmap

2:44:00in this kind of a

2:44:01scenario is this part

2:44:04clear is this part

2:44:08clear

2:44:15yep and if You observe carefully I have

2:44:18taken care of login request sign up

2:44:21request forgot password all the three

2:44:24apis I have taken into the odd service

2:44:27class this is how your OD service class

2:44:30looks a here

2:44:35now uh I don't know what exactly this

2:44:38reset password comes into

2:44:40picture how reset password work I I

2:44:43forgot on that part I'll check this part

2:44:46how it works but you really don't need

2:44:47to use like if you understood it's going

2:44:49to be there like how what was the flow

2:44:51of this one I forgot I think the reset

2:44:54password is

2:44:56uh ahhhh now I remember what is this

2:44:59reset password my bad so the thing is uh

2:45:03reset password is this one

2:45:07link so this token which you see token

2:45:11201125 AE hyen A2 B7 and all if I click

2:45:16on this this token

2:45:19will be given over here and you have to

2:45:22give the new password and confirm

2:45:24password and if you click on reset

2:45:26password it will be updating the

2:45:29password make

2:45:30sense so token will be over here so this

2:45:34is a different flow because then there

2:45:36are lot of things that comes into

2:45:38picture I have to read the inbox

2:45:42inbox

2:45:45token I have to attach it to the payload

2:45:49all those things so I'll keep it in a

2:45:51different lecture okay it will be kept

2:45:53over there on the LMS but this is

2:45:56something which you can say as a

2:45:58challenge in your automation framework

2:46:01that link was going over here and there

2:46:03and then you had to uh take the token

2:46:06expiry of the token and all those things

2:46:09okay also one more important

2:46:12thinga if the reset password link has

2:46:15been sent you cannot again say reset

2:46:18password make sense

2:46:21so if I go over

2:46:23here to my test and I say run this

2:46:28particular stuff now it is going to fail

2:46:31because

2:46:33link

2:46:36okay it is not going to

2:46:38work you have to use that link first

2:46:42update the

2:46:43password getting the point else a new

2:46:46link is not going to be generated and

2:46:48given

2:46:49is this part clear to

2:46:51everyone so please make sure you

2:46:53remember this particular point because

2:46:55else when you will be testing you'll say

2:46:57link because you you already have a link

2:46:59you solve that link first

2:47:03okay

2:47:05now this is all about the OD service

2:47:07that we had now I want to go to the user

2:47:11Management Service let's say the new

2:47:13requirement is user management fix AP

2:47:19uh I'll go with the get profile first

2:47:21because uh put may obviously we have to

2:47:24change password I don't want to change

2:47:25password at this particular moment so

2:47:27over here API sluser SL

2:47:32profile now what all things are changing

2:47:34over

2:47:35here is the base URI changing sorry base

2:47:39path changing first I was on API o now

2:47:43the base path has become users there's a

2:47:46change in the path yes no

2:47:49there's a change in the path yes next I

2:47:52have to make a get request is the HTTP

2:47:55verb different the answer is yes so I

2:47:58have to make two changes first I have to

2:48:01make the change in the base disservice

2:48:04because get

2:48:07request so since get request is coming

2:48:09into picture I have to make change in

2:48:11the base service and since the base path

2:48:14is changing you have to create a new

2:48:16class now yeah authentication Service

2:48:19make sense to everyone

2:48:22everyone right so what you will do is in

2:48:26your service let's start with the Base

2:48:31Service uh I'll minimize it off and I

2:48:34will be

2:48:35creating

2:48:37a new

2:48:40method which is going to be called as

2:48:42get request in life now get request is

2:48:45the most simplest one why because get

2:48:48request

2:48:54pay so I don't need

2:48:57this I don't need content

2:49:00type get request is going to be directly

2:49:03getting the data so you have to do this

2:49:06is this part clear done I made the

2:49:08change over

2:49:10here is this part clear what I done over

2:49:14here now I need to introduce the new

2:49:18service

2:49:19layer which I'm going to call this

2:49:21as user profile

2:49:27Management

2:49:30Service it is a service this service is

2:49:32going to

2:49:33extend Base

2:49:39Service

2:49:41clear next what I'm going to do I'm

2:49:44going to create a base path private

2:49:46string okay uh base underscore path

2:49:51equal

2:49:59to thing

2:50:09is clear to

2:50:11everyone base user is constant so this

2:50:15is going to become final if something is

2:50:18final it will be

2:50:24static any concerns so far same thing

2:50:28whatever we have seen pure Java nothing

2:50:29fancy over and here we have encountered

2:50:33the first uh or the second API that is

2:50:36get one I want to focus right now so get

2:50:39is going to give me get profile right so

2:50:41I'm going to create a method over here

2:50:43called public

2:50:45void get profile

2:50:52okay and how do I get profile I have to

2:50:56call the get request

2:50:59internally and I have to give the end

2:51:04point clear to

2:51:07everyone

2:51:09done get request returns

2:51:12me what response

2:51:20whoever was asking me authorization

2:51:24token so first I will be creating a

2:51:28class now I want to check get

2:51:32profile

2:51:36request

2:51:39test

2:51:45okay get BR should come thanks I keep on

2:51:49forgetting I'll fix it all but the

2:51:50problem is I keep on forgetting all

2:51:52these things thank

2:51:55you okay so Bas path plus forward SL

2:51:59profile this is something that I put it

2:52:00off over here and uh

2:52:04now what I need to do is I need to go to

2:52:07the get profile request test over here

2:52:09as usual you're going to introduce your

2:52:11test

2:52:12NG okay I'm not putting the description

2:52:14and all you know you have to put it off

2:52:16I'm just going to say get profile info

2:52:19Test

2:52:21Now how do I get the get profile info

2:52:25understand this part

2:52:26either back back

2:52:32sorry okay in order to get the profile

2:52:35information first thing the user needs

2:52:37to do is login into the

2:52:40application then I have to go to profile

2:52:44option profile information yes or no so

2:52:48are you getting the flow the flow

2:52:51is login into the

2:52:54application from login if the

2:52:57credentials are correct then I can go

2:53:00and use the profile

2:53:01service make sense to everyone there is

2:53:04a flow that comes over here the user

2:53:07authentication user profile service

2:53:10access okay and obviously the reason is

2:53:13authorization token will be coming into

2:53:15picture so over here

2:53:19if I go over here and let's say I try to

2:53:21access this thing let's say I say try it

2:53:24out I click on execute it's not going to

2:53:26work it's going to say unauthorized full

2:53:28authentication Services required so in

2:53:32order to make this API call I need to

2:53:34pass the authorization

2:53:36token

2:53:38token who creates the token for us the

2:53:41Au service so over here my guys even

2:53:45though I want to use the user manage

2:53:48agement

2:53:54service and thing for token is OD

2:53:57service is responsible so I'm going to

2:53:59say OD service OD service equal to new

2:54:02OD service and from this OD service I

2:54:05will be using the login request and

2:54:10technically you will be just passing the

2:54:12payload of ud's credentials udai 1 234

2:54:16okay and here also udai 1 2 3

2:54:204 what does your login method is going

2:54:25to return

2:54:26me what does login method returns me

2:54:32response to is response L

2:54:36observe this response

2:54:39L then I will deserialize it response.

2:54:43as have I created a payload for the

2:54:46login response

2:54:49API models

2:54:51respon

2:55:05respon what does this return me guys

2:55:08response. as login response what it is

2:55:11going to return

2:55:14me log response

2:55:18login response come so I have to just

2:55:22create a login reference over here now

2:55:25this is where your D serialization comes

2:55:28into picture which takes things to the

2:55:30next level okay

2:55:54login response dot have we created gets

2:55:58yes get do you see a method called get

2:56:01token

2:56:02anywhere yep the third

2:56:05method token value so if I run

2:56:09it if my credentials are

2:56:12right I'm able to see the authorization

2:56:15token coming into picture which I need

2:56:16for the user service

2:56:19token copy and I go to this uh user

2:56:26profile service and you see this lock I

2:56:30click over here I give the bearer token

2:56:32over here click on

2:56:34authorize okay let's click close And

2:56:36click on execute now you're going to get

2:56:39the

2:56:40response so over here if I have to pass

2:56:43the authorization token I have to have

2:56:46this header hyphen Edge which means I

2:56:48have to have this

2:56:50header tell me something who is

2:56:52responsible for creating the API request

2:56:55in my framework which class is

2:56:57responsible for that authentication

2:57:00Service user profile service or Base

2:57:03Service who is responsible for creating

2:57:05the API request on getting me the

2:57:10response who can get that stuff for

2:57:12me who can get the stuff for me the base

2:57:16service is responsible perfect base

2:57:18service is responsible so whose job is

2:57:21to set the authorization token for me

2:57:24Base Service so over here I will

2:57:27introduce a new

2:57:32method in my base service class and the

2:57:36job of this

2:57:40method job of this particular method

2:57:43will be to set authorization token for

2:57:45us so I'm going to say it's going to

2:57:49just give me void set o

2:57:54token

2:57:57okay I will be getting the token I like

2:57:59I'll be giving the token and to the

2:58:02request specification dot dot

2:58:06header okay I can pass the

2:58:09header see header the first is I need to

2:58:12give authorization token take this

2:58:21then Bearer word needs to be

2:58:26return okay be

2:58:29space you have to observe carefully be

2:58:31space colon is basically the first key

2:58:34this is the key this is the value so

2:58:36Bearer is the word and then to this

2:58:39Bearer word I need to attach the

2:58:42token I need to attach the token

2:58:51okay now I have introduced this method

2:58:55and the job of this method is to just

2:58:56attach the authentication token for this

2:59:00particular

2:59:01request

2:59:03story because I need to pass the

2:59:05authorization token I have to go to the

2:59:08user profile and whenever you decide K

2:59:13Baba I will be making this get request

2:59:16and all those things you have to make

2:59:19sure that you pass the authorization

2:59:22token over

2:59:24here so I will be giving the token to

2:59:27this method Dam method code token and it

2:59:31is going to internally call the set

2:59:33token method for us so in order to get

2:59:38the profile authorization token will be

2:59:40set and then the request will be made

2:59:42and I will be returning the response

2:59:44back so since I've introduced this

2:59:46change now if I go back to to my

2:59:49test which I have not called it so far I

2:59:52have the token with

2:59:54me all I need to do is I'm going to say

2:59:57user profile Management Service do get

3:00:01me the profile I'm giving you the login

3:00:04request

3:00:05token and it is going to return me the

3:00:10response

3:00:15okay you can use the same variable

3:00:17because because we don't need to use it

3:00:19we are not doing any kind of an updation

3:00:22over there internally so we can use this

3:00:23part and I can just say system.out.print

3:00:26Ln

3:00:36response

3:00:38a are you able to see the data ID is

3:00:42three username is udai email is this

3:00:45first name is rajaj last name is Kumar

3:00:48make sense to

3:00:50everyone make sense to

3:00:52everyone yes

3:01:01no

3:01:04now over

3:01:07here the response which I'm getting back

3:01:10is in Json

3:01:12format maybe for assertions I want to

3:01:15deserialize it so what you're going to

3:01:17do do you're going to create

3:01:19a what a response model so go to this

3:01:24response model you create a class and

3:01:26I'm going to call this class as uh user

3:01:29profile

3:01:31response okay paste it you know what to

3:01:35do crl

3:01:36F control F okay find me a double code

3:01:41replace it with nothing find me a colon

3:01:45replace it with semicolon

3:01:49okay this is a contrl f find me a double

3:01:53code replace it with nothing

3:01:56yeah

3:01:59done this is

3:02:03three okay this is

3:02:07string I don't know it did not change

3:02:12it control F find me a colon replace it

3:02:16with semicolon

3:02:34done

3:02:35done you know you have to create a pojo

3:02:38class out of it I've done this chap now

3:02:40right click Source generate the

3:02:42Constructor using the

3:02:45fields right click Source generate the

3:02:47two two string

3:02:53method let's generate gets and Setters

3:03:05first okay and then all I need to do is

3:03:09instead of doing response. ask pretty

3:03:12string I can just say response. as which

3:03:16class get

3:03:25profile user profile

3:03:35sorry now if you see carefully

3:03:37everything is kind of similar I'm just

3:03:39repeating the same operations again and

3:03:42again confidence it's the same thing I'm

3:03:45doing I'm not doing anything fancy or

3:03:47anything new once you

3:03:51understand

3:04:04system okay I'm just printing the

3:04:06username so if I'm not wrong UD 1 2 3 4

3:04:09should be printed on my

3:04:13console uh ah Jackson Jackson binding so

3:04:17so over here you have to just make sure

3:04:20that you have a default

3:04:24Constructor

3:04:30done yeah UD 1 2 3

3:04:334 is this part clear to everyone what

3:04:36I've done so

3:04:46far yep everyone in the people in the

3:04:49call all

3:04:53good yes

3:04:57no

3:05:01right how did I resolve the last error

3:05:04last error is because of this last time

3:05:06also I had this

3:05:12error if you look carefully it's written

3:05:16cannot construct instance of response

3:05:18profile projo no Creator like default

3:05:21Constructor exist so it's telling me

3:05:23that there is no default Constructor in

3:05:25user profile response so I have to

3:05:27create that Constructor that was the

3:05:30issue okay that's

3:05:34finish how long the token is valid and

3:05:36can we create entry to request token as

3:05:41and when required and pass it to the

3:05:43other request and that's the problem we

3:05:45have solved it with the

3:05:46authentication uh

3:05:53service

3:05:56Tok

3:05:58token okay token I feel is

3:06:03uh it's valid for a long time I believe

3:06:06it's valid for 24 hours or something but

3:06:09the thing is whenever you want you can

3:06:11create it that's as simple as that call

3:06:15token okay 2 for us

3:06:18yeah and one more thing that you can do

3:06:21over here is you can just create a

3:06:22service out of it you can create a

3:06:23utility method called get token or

3:06:26method call okay inside lines call make

3:06:31sense you can create a utility method

3:06:33just call the Au service get

3:06:35authorization token and internally you

3:06:37call this method so whenever you want

3:06:39you call that

3:06:40method

3:06:42okay is this part clear what I've done

3:06:44over here so this is the first API call

3:06:47where I am doing the authentication

3:06:49second one where I am getting the user

3:06:51details now

3:06:53probably we have three or I don't know

3:06:57how many Base Service we have we have

3:06:59post get put uh post get and uh set is

3:07:03there authorization token which is there

3:07:06I'll just take one more for now and then

3:07:08we can stop this one I'll take a very

3:07:11simple one I'm not going to do the

3:07:13delete one account

3:07:14delete so I'll go with the

3:07:18update so over here I can update

3:07:21the uh what update the personal

3:07:26information okay so this is the pojo for

3:07:28that I believe we have that

3:07:32pojo hope

3:07:35so

3:07:38uh no we don't have it but we can

3:07:41quickly create one I'll create it in the

3:07:44Builder format also so that it's going

3:07:45to be a quick revision for that so I'm

3:07:47going to create a class and I'm going to

3:07:49call this particular class as

3:07:51uh profile request

3:07:54pojo okay profile

3:07:57request okay and over

3:08:03here it will be private

3:08:10string clear to

3:08:13everyone next I need to remove these

3:08:15chaps

3:08:19next I need to remove these double codes

3:08:21and

3:08:23all next I need to remove this colon and

3:08:26put

3:08:29semicolon again once you get comfortable

3:08:32with these things now see the like for

3:08:35practice purpose and all you are doing

3:08:37fine great but later on you just give it

3:08:39to GPT and all

3:08:41it's so I'm going to right click go to

3:08:44Constructor paste it off right right

3:08:47click Source generate the Getters and

3:08:51Setters right click Source generate the

3:08:54two string method done do you want to

3:08:57create a builder for this let's create a

3:08:58builder for this last one we'll quickly

3:09:00do the last Builder creation though this

3:09:03particular class does not require a

3:09:04builder creation

3:09:06varable but still if you want you can

3:09:08create it off for practice

3:09:11um what do you mean by Builder design

3:09:13pattern Builder design pattern is going

3:09:15to be accomplished with the of which

3:09:18classes in Java inner classes in Java so

3:09:21what I'm going to do is I'm going to

3:09:22create a inner class what is the special

3:09:25about inner class a class which is there

3:09:27inside another class is called as inner

3:09:30class inner class are which what in

3:09:33nature static in nature so

3:09:35static

3:09:38Builder is this part clear to

3:09:41everyone yes or no

3:09:43fer okay quick quick this is something

3:09:46that we have

3:09:48now whatever the instance variable which

3:09:50are there in the profile request UT or

3:09:52chip finish then what you going to do

3:09:56you are going to create individual

3:09:58methods for now public void first

3:10:04name first name is actually a method

3:10:07which is going to just do the job of the

3:10:08setter for me okay so I'm going to pass

3:10:11the first name to this chap

3:10:18and it is a

3:10:21Setter so this is the code of exactly

3:10:23the setter that you

3:10:25create and what exactly this method

3:10:27needs to return me the current object of

3:10:30the Builder class

3:10:33return

3:10:36this or is return this to what will be

3:10:39the return type of this first name

3:10:40method

3:10:42Builder katam KH

3:10:45finish copy this

3:10:472 3 4 take the last name put everywhere

3:10:51last name last name last name last name

3:10:54done next email copy

3:10:57this email email email email next one

3:11:02mobile number take this put it here put

3:11:05it here put it here put it here next one

3:11:09more thing is remaining what is the

3:11:10Builder class ready no we have to create

3:11:12one more method which is called as the

3:11:14build method or whatever you want to

3:11:16call it let's say build

3:11:17and the job of the build method it is

3:11:19going to create the object of outer

3:11:22class so over here I'm just going to say

3:11:24profile

3:11:27request profile

3:11:32request equal to

3:11:35new profile request and just keep

3:11:37everything as it is because the names

3:11:40were given in such a way Baba it is only

3:11:42going to pick up the instance variable

3:11:44and I'm going to say return

3:11:47profile

3:11:48request if I'm returning profile request

3:11:51what will be the return type of this

3:11:53method the reference of parent uh sorry

3:11:56the reference of outer class

3:11:59finish life is good done you have

3:12:01created this Builder

3:12:03class okay I just created it for your

3:12:06practice apart from that there's no need

3:12:07for me to create this chap all right so

3:12:10done now let's create a method over here

3:12:13and I'm going to call this particular

3:12:14method as update

3:12:18profile

3:12:20test that's what we want to do let's go

3:12:23over here let's remove all these things

3:12:26we'll do it from scratch now I want to

3:12:30test uh the update

3:12:33request what type of HTTP verb is this

3:12:36put do I have a put request in my base

3:12:39service base service

3:12:42request

3:12:45no API API for/ user is the path so over

3:12:50here which uh class will be updated over

3:12:53here profile service class okay so I

3:12:57have to make two two changes over there

3:12:59that's the maximum I need to do I will

3:13:01be going to the base service first let's

3:13:03go to the base service and um nothing

3:13:06fancy just copy this uh post request

3:13:11only is put

3:13:15though because in post put okay you

3:13:19generally pass payload okay so that will

3:13:23be there only the end point will change

3:13:24over here to put backy sub same

3:13:28okay now in the user Management Service

3:13:31uh I will create a

3:13:34method

3:13:36now I don't want to call it get profile

3:13:40I'll put call it update profile because

3:13:42it is a put operation so update profile

3:13:51and of course if I want to update the

3:13:53profile now if I log

3:13:55out close even if I want to try out

3:13:59let's say I click on try out and I click

3:14:01on

3:14:02execute

3:14:04because in order to update the profile

3:14:06authorization token needs to be

3:14:10there okay so over here set

3:14:14authentication token will happen into

3:14:16picture you have to pass the token and

3:14:18you have to give me the

3:14:32payload okay object payload or what what

3:14:36was the payload over here we have

3:14:37created

3:14:41uh user profile

3:14:45no I created a payload over here now

3:14:49profile request

3:14:53payLo okay and I'm not going to make a

3:14:56get request it is going to be put uh put

3:14:58request so I'm going to say put request

3:15:01you have to first give the

3:15:03payload then this chat

3:15:06finish

3:15:07finish then go back to your update

3:15:10profile

3:15:11test update

3:15:14profile in order to update the profile

3:15:17first I need to log observe

3:15:19carefully log

3:15:23out once I log in into the application

3:15:26authorization token will be created then

3:15:29I need to go to profile option then I

3:15:32need to click on edit to authorization

3:15:35token is activated it's already there so

3:15:37I can start making the changes over here

3:15:40and the same flow will happen here also

3:15:42first I have to call the Au service

3:15:47equal

3:15:48to equal to new Au service then I'm

3:15:52going to say Au

3:15:53service. login and I can give the

3:15:57payload uh UD 1 23

3:16:004 UD 2 3

3:16:034 this entire thing returns me what

3:16:07response are you there with me or left

3:16:10by all good response

3:16:13response okay now I'm going to say

3:16:16response

3:16:17do as we will deserialize the response

3:16:21to login

3:16:24response dot

3:16:26class okay now this will return me an

3:16:31object of login response the login

3:16:36response login response and then then we

3:16:40got the authorization token as simple as

3:16:43that user profile service so user

3:16:48profile Management

3:16:51Service user Management Service equal to

3:16:55new user Management

3:16:57Service

3:17:01okay I'll say user management profile

3:17:04service. get me the profile in order to

3:17:08get the profile I need to pass the token

3:17:10to l respon login response. get me the

3:17:14token

3:17:18so it is going to give me the response I

3:17:20can use the same response

3:17:25variable

3:17:28next let's do one more thing let's keep

3:17:30on printing the response also so I'm

3:17:32going to say response. as pretty string

3:17:34for this chat and take this put it over

3:17:38here for better

3:17:45readability this is where my first

3:17:47request will end I will see the response

3:17:50this is where my second request will be

3:17:51made I can see the response and then I

3:17:54will D serialize the response if you

3:17:56wish you can do that part okay I can

3:17:59just say system.out.println

3:18:02sorry response.

3:18:05as

3:18:07user profil response.

3:18:10class

3:18:15okay user profile

3:18:18response I don't know user profile

3:18:23response and uh

3:18:26probably I can just introduce some kind

3:18:29of an assertion assert

3:18:31dot assert

3:18:34equals user profile response do get me

3:18:38the uh first name not enough the first

3:18:41name get me the

3:18:43username and username needs to be udai

3:18:451234

3:18:49right because username you're doing it

3:18:50for login next this part is

3:18:54done this is the second API request

3:18:56which I made now let's go to the third

3:18:58one third one I don't have to create an

3:19:01object because me user profile service

3:19:04access so user profile service is

3:19:06already there token is already

3:19:09set

3:19:11use user profile service

3:19:14do uh update profile

3:19:17okay update the

3:19:19profile I can pass the authorization

3:19:22token in this kind of a

3:19:29scenario

3:19:31login response. getet

3:19:35me uh

3:19:37sorry login response doget

3:19:42token get

3:19:44token and I need to pass

3:19:47profile request payload Builder I I have

3:19:51to create the payload I'm going to say

3:19:56profile request profile request equal to

3:20:00new profile request dot

3:20:05Builder dot whatever you want first name

3:20:10Raja I'll say

3:20:12thisha next dot last name I'll say say

3:20:16but I'm just changing the name of this

3:20:19user okay so these informations are

3:20:21getting

3:20:22updated um

3:20:25email I can just give a different email

3:20:28disha1 1234@gmail.com

3:20:34okay dot what else we

3:20:40have just

3:20:44give Okay so sometimes the suggestions

3:20:47over here

3:20:49by dot mobile

3:20:52number

3:20:5477777 1 1 2

3:20:583 4 5 done and then finally I'm going to

3:21:03call the dot

3:21:04build you created

3:21:08the you created the profile request

3:21:13payload with the help of Builder design

3:21:15pattern take this is

3:21:18attach what you will get return

3:21:21response so just take the same variable

3:21:25put it over

3:21:26here we have not deserialized it so I'm

3:21:30just going to say

3:21:31response that's

3:21:35pretty clear to everyone people in the

3:21:41call

3:21:43okay and if everything works fine should

3:21:46work I don't

3:21:50know okay it works UD 1 2 3 4 password

3:21:54is not updated but everything else is

3:21:56updated so if I just go to account and

3:21:58then say I decide to go to

3:22:00profile okay let's say I update this

3:22:02stuff did not happen let's log

3:22:07out uh

3:22:14close what's same credentials that you

3:22:17damn man okay let's check over

3:22:23here response dot as pretty string no my

3:22:27bad this this is not one this is not the

3:22:29one which is running right click run as

3:22:32test NG

3:22:36test okay yeah this is

3:22:40the uh response from the first one this

3:22:44is the response from the second one

3:22:48or

3:22:50update so these things are getting

3:22:52updated so if I go to the application

3:22:55now okay and I decide to go

3:22:59to

3:23:01profile disha but email mobile

3:23:05number done clear to

3:23:09everyone yes or no

3:23:17everyone people in the call who stayed

3:23:18back so

3:23:22late okay I took a very decent flow over

3:23:25you can keep on continuing you want you

3:23:27can update the password continue

3:23:29password

3:23:30update okay so if you want you want to

3:23:33update password and all those things

3:23:35those things will work so that's the

3:23:37stuff over here guys uh this was a

3:23:41framework which I've created recently so

3:23:42I thought I'll probably give it to you

3:23:44guys so

3:23:46I hope you have understood how and how

3:23:50these things are built okay you can use

3:23:53it in your office project you can use it

3:23:55wherever you want next class next

3:23:58Saturday when I'll be connecting with

3:23:59you guys

3:24:02I for delete what's the confirmation

3:24:05code what's the confirmation

3:24:07code delete I think so I haven't tested

3:24:12the thing is that feature is not there

3:24:13on the UI right now so

3:24:17because I didn't wanted people to delete

3:24:18their account but uh the thing is

3:24:22uh if let's try to see if there's a

3:24:25delete test in front of

3:24:28you

3:24:33okay don't delete this account

3:24:37okay so over here TR

3:24:41off string

3:24:47M I don't want to take a risk over here

3:25:25confirmation code will come on your

3:25:27email and all you you can't really do it

3:25:29from here it like there's an admin and

3:25:30all those things comes into picture so

3:25:33in the admin controller he can control

3:25:35like whose account can be deleted

3:25:37updated and all so that there's going to

3:25:39be a confirmation code that comes okay

3:25:41probably it goes into the email and all

3:25:44so that's the flow over there probably

3:25:46check on that one now

3:25:51uh hope you got the end to end flow

3:25:55guys it is not going to be uploaded uh

3:25:59directly in the self-pace section right

3:26:01now as I've said I'll probably I'll put

3:26:04it over here

3:26:08document I'll put a YouTube link over of

3:26:10that particular video you can watch it

3:26:11directly here itself okay so in the

3:26:14documentation and the it will be there

3:26:18um I'll tell my folks to combine

3:26:20yesterday's and today's lecture together

3:26:23and remove the unnecessary part where

3:26:25there is a delay or a pause or something

3:26:26like that so that you can watch it in

3:26:28one shot make

3:26:30sense

3:26:32better all right so that's something

3:26:34that I'll you'll find it over here

3:26:36itself on this notion page whatever the

3:26:38URL you have you can bookmark

3:26:41it okay so I hope this particular

3:26:44session was useful to you guys man like

3:26:47uh I did change a lot of things in the

3:26:49framework for uh like previously if

3:26:52you're coming from different batch that

3:26:54time the framework was different this

3:26:56time I made a lot of difference over

3:26:58here the only reason is like lot of

3:27:00things comes changes here and there and

3:27:03um I just wanted to make sure like there

3:27:05are people from The New Batch also like

3:27:07they might be aware of basic things so

3:27:09that's the reason I kept it open for

3:27:11folks

3:27:14so that's uh not a good compliment Mano

3:27:19but anyways that's fine so the thing is

3:27:23um this is just the subset okay which I

3:27:27have created it off over here uh

3:27:29probably on the LMS you'll find more

3:27:31because

3:27:33um uh I was working on um uh like when I

3:27:38get time to study I prepare those things

3:27:40these days I don't get time but the

3:27:42thing is

3:27:43um a lot of things can be introduced

3:27:46used in your project like security

3:27:49testing okay uh I wanted to add it in

3:27:53this ecosystem itself in the live

3:27:55sessions it practically won't be

3:27:56possible for me

3:27:59so the thing is this might be

3:28:04the the subset which I wanted to create

3:28:07as of now so that you can showcase it in

3:28:08the interviews and all so just wait till

3:28:11January end or Fe first week or

3:28:14something the O swap will come into

3:28:16picture where you can do the

3:28:17vulnerability testing of the apis it

3:28:19will be there on the LMS okay that I'll

3:28:21probably not be able to take it in the

3:28:23live classes but uh live classes uh like

3:28:28Jan end Feb end whatever it comes into

3:28:31picture for me right now the most

3:28:33important thing is to complete with the

3:28:35uh topic of your objectoriented

3:28:37programming so I just made sure that the

3:28:39things which we are learning right now

3:28:41okay and what you're doing right now you

3:28:43keep on revising those Java Concepts

3:28:45over there so that when those topic

3:28:47comes it's not something that you are

3:28:48getting scared of what exactly it

3:28:51is it's like just a library I have to

3:28:53introduce and it is just going to take

3:28:55care of the vulner vulnerability checks

3:28:58over here database testing generally I

3:29:00don't try to put it over here but it's

3:29:02just an end to end check so again you'll

3:29:04find something in the jdbc and all those

3:29:06things uh jdbc connector when the last

3:29:09topic of java will be there so there is

3:29:11a change in the Java curriculum also

3:29:13I've done it and um

3:29:17uh the last topic I think so was

3:29:19collections or a list and all that I

3:29:21take it off but two basic things that

3:29:24I've added is the jdbc connector and

3:29:26logger logger you don't really need to

3:29:28watch also because if you have done the

3:29:30Tet assignment that's the exactly same

3:29:32thing that I'm I'll be teaching over

3:29:33there

3:29:35so same year also if you want to

3:29:37introduce logger it's it's just a 2

3:29:41minute task you know you just need to

3:29:44make sure that the log 4G XML file is

3:29:46added you add the respective Library log

3:29:494G XML file loger utility copy

3:29:54Pasto okay and then you use it off those

3:29:57things I'll be taking it in the next

3:29:59class that is this next Saturday um that

3:30:02is going to be the day three part okay

3:30:04and in day three we'll just understand

3:30:06the final finishing touch I won't be

3:30:08writing any API test that time okay so

3:30:11you guys can practice It Off by yourself

3:30:12over there um these things will be

3:30:16introduced what will be filters how

3:30:18exactly lock files will be created your

3:30:20xmls and all those things how to run the

3:30:22test NG test in parallel

3:30:26mode but I'll just do it in front of you

3:30:28guys how to do thread save testing

3:30:31meaning if I'll be testing individual

3:30:33apis parallely how I can do it off okay

3:30:36finally I'll end that particular class

3:30:38this particular class on Sunday uh where

3:30:41we will be doing the Final Touch where

3:30:43we will integrate it with the GitHub

3:30:45actions okay so you will have an end to

3:30:47endend framework of API testing just

3:30:49like how you have done it for tet that

3:30:52this particular framework is also

3:30:53getting integrated with your CI tool

3:30:56make sense to

3:30:59everyone I think day three is something

3:31:02that you can do it by yourself okay so

3:31:05please try to do it yourself first

3:31:07because it is going to give you a lot of

3:31:10confidence this is not what I'm doing

3:31:12over here is just like I'm explaining

3:31:14you the code but unless you are writing

3:31:16the code you will not get that

3:31:19confidence huh who as I said it will be

3:31:22uploaded in the combine yesterday's and

3:31:24today's class I'll combine it off

3:31:26yesterday's class I have already

3:31:27uploaded in your respective batches okay

3:31:34oml only in the selfed class it is not

3:31:37there

3:31:38okay a this also I forgot to read this

3:31:42word okay I'll do that part over there

3:31:46that's a WRA okay so I'll end it off

3:31:48over here guys uh thank you so much for

3:31:50your time guys I'll see you guys in the

3:31:51next one okay take care bye-bye I hope

3:31:54you are confident and please start

3:31:56giving interviews the only reason I have

3:31:58to combine the multiple batches and take

3:32:00this topic is so that you feel confident

3:32:03API

3:32:04framework there was this one like

3:32:07student Monica okay she's not there

3:32:09today I

3:32:12guess so thank her not me okay I'll take

3:32:16care guys I'm you're you're great okay

3:32:19yeah like I keep people on mute now

3:32:22so I don't I'm not used to of all these

3:32:26silence okay so that's the thing okay so

3:32:30I hope you got the confidence Monica

3:32:32just build this particular project use

3:32:34the tell it part and I think you're fine

3:32:36with this stuff okay so the various

3:32:38design patterns just to repeat Builder

3:32:41page object service object

3:32:43factory factory terms of in terms of

3:32:47your what uh authorization W part yeah

3:32:52for Phoenix application those things

3:32:54you're done and end to end integration

3:32:56over there okay chali I hope it's clear

3:32:59to

3:33:00you right everyone comfortable with

3:33:03these things

3:33:06now okay by people who joined recently

3:33:12anud

3:33:14niharika

3:33:16shda yes

3:33:19okay actually so practice this part I'll

3:33:23update this particular document probably

3:33:25tomorrow or something so you can use

3:33:27these things over here okay uh as a task

3:33:31as your assignment or something if you

3:33:33want to practice more try to create

3:33:36all

3:33:37swag so I will just suggest like you go

3:33:42for user management only HTTP so you can

3:33:45just do that part confirmation K update

3:33:48how exactly it works over there kyc

3:33:49controller you can do it off there is a

3:33:51mocking which is there like which takes

3:33:53care of UPI transactions and all good

3:33:55luck with that man that's that's a

3:33:57little bit tricky one to handle report

3:33:59can uh report generation okay so this is

3:34:03just a get one it's just going to

3:34:04generate the HTML or sorry the Excel

3:34:07report and PDF report for you guys just

3:34:09a bank

3:34:10statement download all right that's all

3:34:14welcome back to the Channel guys and I

3:34:16hope you guys are doing pretty good so a

3:34:19lot of you guys were saying Please

3:34:20Release the part two of the API

3:34:22automation framework so here it is guys

3:34:25this is the part two of your API

3:34:29automation framework now in the part one

3:34:32guys we saw the first time where we were

3:34:36writing test scripts for your API

3:34:38automation framework with rest is short

3:34:40and particularly we introduced a new

3:34:42design pattern what was the design

3:34:44pattern over there service object model

3:34:47all right now the second thing over here

3:34:50guys we ended up overwriting couple of

3:34:52test for the different components

3:34:54different Services now in this

3:34:57particular lecture we will be speaking

3:34:59about logging how do you log the request

3:35:02and the response and you put it in the

3:35:04log files along with that we will also

3:35:07integrate the framework with GitHub

3:35:09actions so that you have an end to end

3:35:12picture how exactly this test is going

3:35:14to be executed in your CI pipeline now

3:35:18the thing is if you haven't watched the

3:35:20part one okay this particular lecture is

3:35:24going to be a complete bouncer for you

3:35:25guys so I'll advise you guys that if you

3:35:28found this particular video separately

3:35:30on YouTube or somewhere else please make

3:35:32sure you watch the part one okay I'll

3:35:34put the link in the description section

3:35:37or in the comment section of this

3:35:38particular video if you have watched the

3:35:40part one this part two guys is going to

3:35:43be a little bit tricky okay when I was

3:35:45taking taking this particular class for

3:35:47students you know I felt that this

3:35:49particular lecture was a little bit

3:35:51tricky a little bit complicated okay

3:35:53because the concepts which were coming

3:35:55over there was kind of new all right so

3:35:58what I thought is I will put the video

3:36:01where we'll be building the entire

3:36:02framework and all but before that we

3:36:04will just discuss some basic concepts

3:36:07that you should be aware of uh logging

3:36:09and filtering in rest assured is this

3:36:12part clear so we will be just having a

3:36:14theoretical session first for like 10 15

3:36:17minutes and then you can just watch the

3:36:19part where I am building the scripts

3:36:22okay now let's get started see guys this

3:36:26is the part two of the end to

3:36:32endend

3:36:34API

3:36:36automation

3:36:37framework yes or no now in the part one

3:36:42guys what we did was we created

3:36:49the

3:36:51service

3:36:53layers okay and for these service layers

3:36:56I have written the

3:36:58test yes or no so if I have to talk

3:37:01about the structure of my automation

3:37:03framework let me just draw it for you

3:37:05guys over here guys the framework that

3:37:09we have created is basically a Java

3:37:11Maven based project

3:37:15all right now in this Java Maven based

3:37:19project um if you have seen the maven

3:37:21projects that you create you always have

3:37:23SRC main

3:37:25Java okay you have your SRC uh test Java

3:37:30coming into picture now generally you

3:37:34can keep the components in your SRC mean

3:37:37ja also I don't like that particular

3:37:39stuff so I generally keep it in SRC test

3:37:41Java now in SRC test Java the first

3:37:43component that I created was called do

3:37:46api.

3:37:48base so over here I have created a class

3:37:52which is called as this API base. Java

3:37:56and this particular class which I have

3:37:58created is basically what is an

3:38:04abstraction okay over rest assured okay

3:38:09so whenever you are using any Library

3:38:12whenever you decide you're going to use

3:38:14selenium you're to use APM you're going

3:38:16to use rest short you're going to use

3:38:19your Json utility your gson your Jackson

3:38:21coming into picture or you decide to use

3:38:24logger all right any kind of external

3:38:27third party library that you use it's

3:38:30always better that you create

3:38:31abstraction okay so why we did that is

3:38:36so that when I'll be writing my test

3:38:38scripts it's going to be a pretty simple

3:38:42uh Java concept I'm going to create a

3:38:44class I'm going to create an object and

3:38:45I'm going to access the method as simple

3:38:47as that I don't want to write something

3:38:49like given when then so on and so forth

3:38:51now some of you guys will be thinking

3:38:53that Jan you can just use the rest ass

3:38:55short given when then scripts right so I

3:38:57can just create a test method and inside

3:39:00that particular test method I can just

3:39:03write given right then we going to have

3:39:07the

3:39:07header the base URI okay the body and

3:39:13then I can use the wind script where I

3:39:15can just make the post get put delete

3:39:20request and then I can do the assertions

3:39:23the problem with this particular

3:39:25approach when you actually use all your

3:39:28given when then structure over there if

3:39:30tomorrow I am going to make any change

3:39:33in my base URI if there is going to be a

3:39:35change in the body and all wherever

3:39:37these scripts are going to be used in

3:39:40your test you have to keep on making

3:39:41changes so this is not maintainable okay

3:39:45this is not maintainable to overcome

3:39:47this particular problem we decided we

3:39:49will be using a design

3:39:52pattern okay and that design pattern is

3:39:55pretty simple it's there almost in all

3:39:59the applications of the back end we

3:40:01generally use that it's basically your

3:40:04service

3:40:06object design pattern all right we use a

3:40:11service object design pattern and what

3:40:12we do in the service object design

3:40:14pattern is you would be given a Swagger

3:40:16dog right and on the Swagger dog you

3:40:20will be having let's say a service which

3:40:23is which will be given to you let's say

3:40:25we have been given a service called API

3:40:28uh

3:40:29for/ so o over here is my service okay

3:40:32and in od service I will be having

3:40:35various endpoints let's say I I'm going

3:40:36to have login I'm going to have log out

3:40:39okay I can have create

3:40:42account okay something like that

3:40:46now login log out create account these

3:40:48are what end points these are basically

3:40:51going to be the operations that are

3:40:52going to happen in AU service so what

3:40:55I'm going to do I'm going to create a

3:40:57class called Au

3:40:59service and Au service. Java and this is

3:41:03going to extend API base so in this

3:41:07particular class I will be having um all

3:41:10the methods that are there in API base I

3:41:13can easily access it off now in your au

3:41:18service the login log out create account

3:41:21these methods will be

3:41:31there all right these methods will be

3:41:34there and when I'm going to hit a login

3:41:37request what do you get back response so

3:41:41these methods will always return you the

3:41:44response

3:41:47okay will always return you the response

3:41:50now what happens is because we have an

3:41:52OD service class which has these three

3:41:54methods okay what we can do over here is

3:41:57instead of writing the test scripts

3:41:59given when then what I can do is I have

3:42:02to just create the object of OD

3:42:09service

3:42:11okay and I can just access the method

3:42:15I can pass the credentials and login

3:42:18method is going to return me the

3:42:20response and then I'll be validating the

3:42:26response as simple as that maintenance

3:42:29becomes much more easier okay I see a

3:42:32lot of videos over the um YouTube and

3:42:35over the Internet they generally go with

3:42:36the G uh the given B then but they

3:42:38really don't really focus on how exactly

3:42:41you'll be maintaining the scripts in

3:42:43Long Run Okay so for that particular

3:42:46reason you know like it's it's good to

3:42:48learn from those videos but the problem

3:42:50that comes over here is those scripts

3:42:52are not maintainable in the long run

3:42:54okay you will definitely learn rest

3:42:56assur and all and learning rest assur is

3:42:58not a um you know like a complete um

3:43:02complicated thing it's a very simple

3:43:03thing okay so if you are aware of java

3:43:07if you understand how Java Works

3:43:09learning new libraries is not going to

3:43:11be a very de big thing it's a pretty

3:43:14simple thing actually okay so please

3:43:16make sure guys you understand the

3:43:18various design patterns and how exactly

3:43:20you will be maintaining the scripts in

3:43:22Long Run okay you're not just going to

3:43:24write uh 20 30 test think of a bigger

3:43:26number 400 500 test and if there is

3:43:29going to be any kind of a change which

3:43:30will come into picture let's say there's

3:43:32a change in the endp point there's a

3:43:34change in the header there's a change in

3:43:36the body will your test scripts be

3:43:40affected with that okay will your

3:43:42framework will be able to handle those

3:43:45incoming changes the changes which are

3:43:46happening in the development will you be

3:43:48able to incorporate in your framework

3:43:50right those are the things that you

3:43:52should always focus on is this part

3:43:54clear to everyone perfect so we have the

3:43:57comm. API base and inside this API base

3:43:59I have the API base which is basically

3:44:01an abstraction over rest assur and I

3:44:04will create the respective service

3:44:06classes service classes are going to

3:44:08have the respective endpoints of that

3:44:11particular service and all the methods

3:44:13will return me response is this part

3:44:15clear to everyone perfect quickly make a

3:44:17note of this particular

3:44:19point now of course we have the com. API

3:44:22base the next thing that comes into

3:44:24picture is going to be com. api. test so

3:44:27this is where I'll be writing all my

3:44:29test scripts Prest NG and you will be

3:44:32accessing the Au service classes over

3:44:34there or service classes over there now

3:44:36the next thing that will be there in

3:44:38your framework is going to be something

3:44:41which is going to be called as com. api.

3:44:43model yes what is the purpose of model

3:44:47in your model you're going to have two

3:44:48things request and

3:44:50response what you're going to have

3:44:54request and

3:44:56response what is this request and

3:44:58response you have to attach payload now

3:45:00you have to attach payload you will be

3:45:02getting the response back in Json format

3:45:04then you need to also assert them so

3:45:07what we do we will be creating the Java

3:45:11classes or some of you guys call them

3:45:13pojo classes

3:45:15okay and these pojo classes will be uh

3:45:18created for both both request and

3:45:20response benefit you can easily pass the

3:45:24the data you don't really need to

3:45:26hardcode you don't need to keep the Json

3:45:28somewhere of course you can do that

3:45:29approach also because rest short

3:45:31provides you with different ways of

3:45:32passing the data to your API request

3:45:35right so over here guys um either I can

3:45:39create a pojo or I can just have a hard

3:45:43copy or a hardcoded Json that have kept

3:45:45it somewhere and I can pass it off over

3:45:47there but we have gone with pojo classes

3:45:50okay so you will always create payloads

3:45:53model okay and you will attach these

3:45:56models in your um login request endpoint

3:46:02you'll pass it to that all right so this

3:46:04is something that we have seen in the

3:46:05past class I'm quickly doing a revision

3:46:07for you guys so that you understand how

3:46:08it's done now the next thing that we

3:46:11have done apart from that I'm just

3:46:14looking at these things what we have

3:46:15done over here we have seen OD service

3:46:17bait service SRC test um yeah that's

3:46:20that's the thing that we have seen in

3:46:21the last class okay now let me just rub

3:46:25this particular board quickly now in

3:46:27today's class guys we will be focusing

3:46:28on two things or I would say three

3:46:31things loggers okay the second thing is

3:46:35going to be

3:46:37filters and the third thing is

3:46:40integrating

3:46:46the

3:46:48framework

3:46:51with your GitHub

3:46:54actions sometimes people ask you are

3:46:56integrating with GitHub action is it a

3:46:58different thing from Jenkins suppose I

3:47:00want to integrate with the framework

3:47:01with Jenkin you can do that okay the way

3:47:04I have created this particular framework

3:47:06is such that you if you want to run it

3:47:08with your GitHub actions or you want to

3:47:10run it with gitlab Runner or you want to

3:47:11run it with your Jenkins the steps

3:47:14Remains the Same okay steps will remain

3:47:16the same you your ultimate goal is to

3:47:19always run the test from the terminal so

3:47:23if I'm able to run the test from the

3:47:25terminal then it doesn't matter whether

3:47:27you do it with GitHub actions your

3:47:31jenin okay you want to uh do it with u

3:47:34let's say gitlab Runner it will still

3:47:36remain the same you just need to know

3:47:37the command how this framework is going

3:47:40to be executed okay if you have uh seen

3:47:43the SD Foundation

3:47:45okay we have discussed this particular

3:47:47part in detail okay I'll put the link in

3:47:50the description section you can check

3:47:51that part also now when I'm talking

3:47:54about logger in Java if I have to

3:47:56generate logs which Library comes into

3:48:00picture log

3:48:024J okay so when you're looking at log 4J

3:48:06guys what happens is you will need two

3:48:08libraries of log 4J you need log 4J API

3:48:13okay and log 4J

3:48:16core okay you will find these two things

3:48:18from the MAV U repository Maven

3:48:21dependencies you can search it from

3:48:22there but these are the two dependencies

3:48:24that you're supposed to add okay now

3:48:28what are filters this is going to be a

3:48:31very important interview questions for

3:48:32you guys like in interview they can ask

3:48:34like if you say that you know API

3:48:36testing and if you have created the

3:48:38framework with rest is short definitely

3:48:40they can ask what are filters now one

3:48:43word about filters that you should

3:48:45always remember is Filters help you

3:48:49intercept yeah what is this intercepting

3:48:53okay what does intercepting means over

3:48:54here intercept basically means that

3:48:59let's say I have something which is

3:49:01getting started from point A and I have

3:49:04to go to point B if there was no

3:49:08interception happening the the thing

3:49:11would have been going in the straight

3:49:12line okay inter interception basically

3:49:15means is this this thing is going to

3:49:17happen in a straight line but someone

3:49:19came in

3:49:21between did

3:49:23something and now it's going to go from

3:49:27C to B so if I want to you know like

3:49:32make some modification in

3:49:36between things are going to move from A

3:49:38to B only but the point is someone is

3:49:41coming in between and making some

3:49:43modifications okay that is what you call

3:49:45as

3:49:45intercepting that is what you call as in

3:49:48intercepting if you if you have seen any

3:49:49football match and all like someone is

3:49:51trying to pass the ball from one player

3:49:53to another player but in

3:49:56between the opponent player comes into

3:49:59pitcher and then they try to take the

3:50:01ball from there that's called intercept

3:50:03means so over here when you look at

3:50:05filters filters are always meant for

3:50:08intercepting so what is going to happen

3:50:11you always let's say you're making a

3:50:13request

3:50:15you're making a request and rest assur

3:50:17now request is going to be made this

3:50:19request has to reach to the server okay

3:50:23this is my server okay but before the

3:50:26request reaches the server okay I want

3:50:29to make some kind of a

3:50:32modification what do you mean by some

3:50:34kind of a modification modification can

3:50:36be anything I want to capture something

3:50:38from the

3:50:39request okay I want to make some changes

3:50:43in the request all all those things I

3:50:45can do it but for us we want to capture

3:50:46something from the request what do I

3:50:48want to capture I want to capture what

3:50:50is the base

3:50:53URL I want to capture the end

3:50:57point I want to capture the header I

3:51:00want to capture the body so that I can

3:51:03log this

3:51:05thing okay in my log file

3:51:09similarly once I capture this particular

3:51:11stuff I will log it and then I will

3:51:14again continue with the request okay and

3:51:18the same thing happens in the return

3:51:19also when the server processes the

3:51:21request it is going to return the

3:51:24response back the before the response

3:51:27reaches your test for further

3:51:28validations you're going to do the

3:51:30testing over there it is going to go via

3:51:32the filter and what filter is going to

3:51:35do again it is going to capture what

3:51:37request to it has captured now it is

3:51:39going to capture the response it's going

3:51:41to capture the response

3:51:44okay what were the

3:51:46headers then what was the

3:51:49payload or let's say the response

3:51:52payload right response

3:51:56time okay then status

3:52:00code all the things I can capture it off

3:52:04okay now the thing

3:52:08is these

3:52:10things okay when the request is made and

3:52:13I'm getting the response back in in

3:52:15between I'm trying to get those

3:52:17informations that is what you call as

3:52:19intercepting and to do that in

3:52:22intercepting you need

3:52:23filters okay this is the theory that you

3:52:25should be aware of all right now so we

3:52:29will see about loggers and you see about

3:52:32filters one more important thing about

3:52:34is these things are I need to capture it

3:52:37off when when my test is getting started

3:52:40okay when my test is getting completed

3:52:42if my test is failing right and need to

3:52:44capture all those things is there a

3:52:46component in your uh API automation

3:52:49framework or in your automation

3:52:51framework that can help you understand

3:52:53which test got started which test got

3:52:56failed which test got skipped is there a

3:52:59way you can get that information yes you

3:53:02get it with the help of yes I know you

3:53:03know the answer how do you get that

3:53:05information you get it with the help of

3:53:08listeners so we will create the

3:53:12component in such a way that filter and

3:53:15listeners are communicating with each

3:53:16other somewhere on the lane we have to

3:53:17do that part okay yes this is something

3:53:20which is important and once it is done

3:53:22okay our main goal is to run the

3:53:24framework from the terminal and in order

3:53:27to run the framework from the terminal

3:53:29you are going to use a very important

3:53:32plug-in very familiar plug-in you might

3:53:34be heard about it if you're using

3:53:37MN have you heard about this plugin

3:53:39called Maven sh fire

3:53:42plugin okay so what I'm going to do is I

3:53:47will introduce the MAV Shire plugin I'm

3:53:49going to pass the parameters okay and

3:53:52those parameters MAV Shi plugin is going

3:53:54to receive it and it is going to execute

3:53:57my

3:53:58test okay so that my command remains

3:54:02something like this Maven test and then

3:54:04you can do the execution all right this

3:54:07is something that we will be building in

3:54:09today's class so make sure guys you

3:54:11create projects you put it in your

3:54:12resume and during interviews you can

3:54:15tell them that this is the project that

3:54:16I have built okay so that it gives the

3:54:19confidence to the interview that this

3:54:21candidate knows what he has done okay

3:54:24what he's aware of okay this is

3:54:26something that you want to um showcase

3:54:29during the interviews else it's it's

3:54:31going to be a very uh difficult thing

3:54:34you know like in long

3:54:36run you have to learn things by building

3:54:39projects and that's the ultimate thing

3:54:41that we do it in the main course also

3:54:43that we always build projects else it's

3:54:47the same thing you come to the class you

3:54:49see someone on the zoom calls okay he's

3:54:51writing the code or she's writing the

3:54:53that doesn't work all right so please

3:54:56make sure guys you complete this

3:54:57particular stuff and in case of any

3:54:58doubts and queries you know where to

3:55:00reach out to me so without wasting time

3:55:02now let's get started with the part two

3:55:05I hope my screen is visible to everyone

3:55:07everyone is able to see the

3:55:08screen yes no Okay cool so

3:55:13probably uh uh just till tomorrow I'll

3:55:15be taking the API automation framework

3:55:17tomorrow by tomorrow it will be

3:55:19completed

3:55:21so um before I start with today's class

3:55:24um I just want to show you what exactly

3:55:29we want to build for today uh just a

3:55:37moment

3:55:40yeah I've already pushed this particular

3:55:43project this is a SE trade project but

3:55:44something similar we will try to build

3:55:46it uh for um

3:55:49today if you have already saw the tell

3:55:51it assignment you will be yeah is my

3:55:55screen visible to everyone right I hope

3:55:56you guys are able to see the screen

3:56:03perfect okay okay so uh something like

3:56:07this I want to build it off so if I go

3:56:10to my actions you know you will be

3:56:15able to execute your API test on your

3:56:20GitHub actions the second thing over

3:56:23here you'll find an option which is

3:56:24called as the test NG results so

3:56:27whatever is the execution of my test

3:56:31which test is passing which test is

3:56:32failing all those things I will be

3:56:35directly able to see it on my GitHub

3:56:37actions dashboard okay now this becomes

3:56:41very useful for people if you are trying

3:56:43to use any CS tool like Jenkins your

3:56:46GitHub actions your gitlab Runner

3:56:48probably I don't want to see the report

3:56:50I can just go to my GitHub repository

3:56:52and I can just see the actions logs

3:56:55right so whatever will be the build I

3:56:57can just go over there and I can quickly

3:56:59check what is working what is not

3:57:00working of course screenshots is not

3:57:02something that we'll be needing over

3:57:04here but having this kind of a dashboard

3:57:07for your API test is going to be very

3:57:09useful now a couple of days back there

3:57:11was this one student of mine who was uh

3:57:13called this particular uh interview

3:57:15question what are the enhancement that

3:57:17you have made in your framework right so

3:57:20you need to be sure that you just don't

3:57:22say one or two things you really need to

3:57:24have a lot of things in Your Arsenal

3:57:27right you should really talk about like

3:57:29these things like how the dashboard got

3:57:31created how you are integrating it with

3:57:33GitHub actions the various design

3:57:35patterns like I showed you the service

3:57:37design pattern or the service object

3:57:39model that we have seen so far okay how

3:57:41you are writing the test if you have

3:57:42seen the tell it assignment how we try

3:57:44to optimize the test scripts okay how

3:57:47you're avoiding IFL statement

3:57:49conditional statements your Loops your U

3:57:52TR catch your uh you know like iterators

3:57:55and all those things in your test the

3:57:58test is always meant to be kept clean

3:58:00small simple so that it's easy for the

3:58:02uh easy to execute it off isolations of

3:58:05the test that we have done so far so

3:58:07that's something that you know like you

3:58:08really need to be aware of whenever you

3:58:11know like if they ask for the

3:58:12enhancement perspective now the notes

3:58:15for this particular stuff I have already

3:58:17published it off uh I don't how many of

3:58:19you guys have practiced day one and day

3:58:21two whatever things we have done over

3:58:23here are have you Revisited it off is

3:58:27this yes no that's more important can

3:58:30you put it in the chat box

3:58:33everyone because if you have done then

3:58:35day three and day four is going to be

3:58:36pretty simple nothing fancy I'll be

3:58:38teaching uh over here it's just going to

3:58:41be the implementation part which is

3:58:43going to be done so if you are just

3:58:45going to complete till tomorrow or

3:58:47something you're done with the API

3:58:48automation framework okay at least

3:58:51something uh awesome that you can really

3:58:54talk about in interviews not even just

3:58:56in interviews you can really use it in

3:58:57your office projects and all

3:59:01so if I go to day

3:59:04three the document is I think so you

3:59:07have bookmarked this particular Ur right

3:59:08so this is going to be the same stuff I

3:59:10have uh just introduced new sections new

3:59:14a study material over there now if you

3:59:18have already solved the Tet interview

3:59:20question this is going to be a cake walk

3:59:22for you okay so this is just a

3:59:24prerequisite I'm telling you that

3:59:26whatever I'll be doing right now is

3:59:29going to be very much similar to the

3:59:31selenium assignment that I've have

3:59:32solved okay and kept on the LMS so this

3:59:36is just an extension for that okay so in

3:59:40today's class we will understand what

3:59:42are filters in rest assured okay and how

3:59:46you're supposed to use filters um we

3:59:50will also be majorly focusing on

3:59:52generating the logs for the test scripts

3:59:56okay so obviously log 4J will come into

3:59:59picture we have we already are aware of

4:00:01how exactly we are using log 4J or how

4:00:04you're supposed to use log 4J in your

4:00:05framework we have done that part so we

4:00:08will integrate it over there okay and

4:00:11most of the things you'll kind of find

4:00:13it is similar that we have done it in

4:00:15the tell it part okay so that's

4:00:17something that will start doing it over

4:00:19here now over here guys the first thing

4:00:24that I want over here if I just go to my

4:00:26test let me just launch the dashboard uh

4:00:29just me a moment I'll be keeping

4:00:31everyone on uh mute for now okay thank

4:00:33you now going back to your demo API

4:00:38automation framework this is what we

4:00:39were working so far so a just quick

4:00:42revisit what we have built so far

4:00:44so over here we started first by writing

4:00:47test right if you remember we were

4:00:49writing the test with normal rest short

4:00:53Ive still kept this particular script

4:00:54over

4:00:55here if you write this particular script

4:00:58like this okay the problem is of

4:01:00Maintenance so we started to do static

4:01:03import meaning if you look carefully

4:01:05rest assured is a class which already

4:01:07has static methods and static variables

4:01:10so you're not supposed to write rest

4:01:12short. Bas URI and all we when when to

4:01:14introduce given when then structure so

4:01:16we write it given base URI header body

4:01:19post so this is basically what you call

4:01:21as method chaining right and uh this was

4:01:26fine okay it was doing decent job but

4:01:29again it is not something which I can

4:01:31use it for testing of microservices

4:01:34because the problem that comes into

4:01:35picture is isolation is not possible

4:01:37there's a hard level of dependencies on

4:01:40each of these test scripts that we'll be

4:01:41writing so we started proving it off

4:01:44over there we introduced the service

4:01:47object model and what service object

4:01:49model does is you are going to create

4:01:52your respective services so I have

4:01:55created this comm. API base package over

4:01:58here the first thing that I created was

4:02:00this Base Service class this Base

4:02:03Service class is basically your rapper

4:02:05over rest assured now we create wrappers

4:02:10so that we can introduce abstraction so

4:02:13over here what happens is instead of

4:02:16remembering this entire chaining of

4:02:19methods though it's not difficult to

4:02:22remember it off but when you write test

4:02:24it looks a little bit complicated so

4:02:27over here guys what happens is when you

4:02:28create these wrapper methods and all

4:02:30writing of my test scripts is going to

4:02:32be simple the same thing I have done it

4:02:34in the browser utility the same thing

4:02:36you do it in your APM utility you the

4:02:38same thing you do it in logger the same

4:02:40thing you do it in extent report the

4:02:42same thing you do it in Excel so no

4:02:45matter what library you are going to use

4:02:48you have to create some kind of a

4:02:49wrapper over it so that it is going to

4:02:52be much more easier for the folks uh

4:02:55people who are writing test scripts to

4:02:58understand what exactly this method is

4:02:59going to do they don't need to do the

4:03:01hard drilling of fixing and

4:03:03understanding the code so over here we

4:03:05have created this particular rapper and

4:03:06over here we have it's going to take

4:03:08care of creating the request

4:03:10specification you can attach the header

4:03:12you can attach the P like you can make

4:03:13make the post request and we directly

4:03:15returning the response over here okay

4:03:18that's something that we have done and

4:03:20for each of the service layer we have

4:03:22respective class so Au service extends

4:03:27Base Service and whatever is the base

4:03:29path I will be creating over here and

4:03:31each of the method will be the

4:03:33respective end points so if I'm going to

4:03:36hit this end point I'll be get getting

4:03:38the response back so internally the

4:03:41login request calls the post request

4:03:43from the base service okay that's

4:03:45something that we have built over there

4:03:46in the previous classes so no matter how

4:03:49many service layers you are going to

4:03:51have you can go to the Swagger do and

4:03:53you will easily understand so if I go

4:03:55over here let's say if I scroll a little

4:03:58bit up and I go to the Swagger do if

4:04:02looking at the Swagger do I'll come to

4:04:03know okay authentication controller I

4:04:06can see a service section whatever will

4:04:08be the apis over here now these will be

4:04:11the methods account account account

4:04:13number with get user these are all going

4:04:17to be

4:04:18my uh methods inside that they will call

4:04:21Post get and get request so account will

4:04:24be my class make sense to everyone yes

4:04:28or no this is something that we have

4:04:31seen so for each of the controller

4:04:34section you will create the respective

4:04:37classes and these respective classes

4:04:40will have these many methods over there

4:04:42so mock UPI controller is is going to

4:04:44have 1 2 3 4 methods all right so that's

4:04:47something that we have

4:04:55built yeah sorry there was a issue over

4:04:59here now the next thing that comes into

4:05:01picture is the request and the response

4:05:04whenever you are going to have any kind

4:05:06of uh

4:05:07payloads right you will be attaching the

4:05:10uh body to the API request so if I go to

4:05:13the Post request

4:05:14probably I want to attach some kind of a

4:05:16body right so these body my dear friends

4:05:19we need to pass to the request and we

4:05:23can pass it off by creating something

4:05:25which is called as models so I have

4:05:28created request model and response

4:05:30models now for most of you guys what is

4:05:32this model and all thinking simple pojo

4:05:34class variables will be instance

4:05:37variable will be private there will be a

4:05:39Constructor there will be Getters and

4:05:40Setters coming into picture all those

4:05:42things you need to create it all of so

4:05:44this is what the model is going to focus

4:05:46on and I have this login request model

4:05:48now over here guys this is something

4:05:51that we have created variables are

4:05:53private then you're going to have login

4:05:55requests get user response Setter sets

4:05:57two string method coming into picture

4:06:00similarly for the response also we have

4:06:01done something similar this is something

4:06:04that we have okay variables are going to

4:06:06be private there's going to be a

4:06:07Constructor so and and so forth that we

4:06:10have created now if I go to the user

4:06:12profile response this is what we

4:06:15have now the next thing that comes into

4:06:18picture is writing of the test scripts

4:06:22so over here if you look carefully for

4:06:25the sign up request the way I have

4:06:28created this particular request which

4:06:30design pattern is coming into picture

4:06:31over here this is the Builder design

4:06:33pattern so sometimes when interview they

4:06:36will definitely ask what are the

4:06:37different design patterns that you are

4:06:39aware of page object okay don't say pojo

4:06:43say your Singleton coming into picture

4:06:45your Builder coming into picture your

4:06:47factory coming into picture the main

4:06:50reason they ask about various design

4:06:52patterns is because if you're using

4:06:55design patterns correctly these are

4:06:58rules if you're implementing the design

4:07:00patterns correctly it means that you

4:07:02have used objectoriented programming

4:07:05correctly okay what is the advantage of

4:07:08having the Builder design pattern the

4:07:10benefit over here that comes into

4:07:12picture is I can pass the par parameters

4:07:13in any order are you getting the point

4:07:16yes or no everyone yes this is the

4:07:19benefit that you get when you're using

4:07:21Builder design pattern so I don't need

4:07:23to remember the number of parameters

4:07:24that are going to be

4:07:27there okay there is already a class

4:07:29which I have uploaded on the LMS so if

4:07:32you go to the LMS you will find

4:07:34something which is called as the Builder

4:07:35design pattern so it is going to give

4:07:38you a better perspective on how exactly

4:07:40things needs to be created over there

4:07:42all right so the

4:07:44complete uh objectoriented programming

4:07:47okay till abstraction it's abstract

4:07:48classes you will find it over the uh LMS

4:07:51so along with that if you're revisiting

4:07:53Java and all okay along with this you

4:07:57definitely want to check those things

4:07:58out it's it's really going to help you

4:08:00out understand things in a much more

4:08:02deeper level now if I go to the sign up

4:08:05request C this is something that we have

4:08:09created sign up request oh this is the

4:08:11Constructor and over here we have have

4:08:13created a inner class okay and over here

4:08:17we have created this Builder class okay

4:08:20so a class which is going to be inside

4:08:22another class is going to be called as

4:08:24your inner class and inner classes in

4:08:27Java is going to be static in nature

4:08:30okay you can make it static it's not

4:08:31necessary it cannot be non-static but

4:08:33for Builder design pattern we try to

4:08:35make it

4:08:36static now there is one more thing that

4:08:39you can really use it to improve it of

4:08:42in Builder design pattern also you can

4:08:45make or you should make the Constructor

4:08:48as private now the question that comes

4:08:51into picture is what is going to happen

4:08:54when you make the Constructor as

4:08:56private okay this can be an interview

4:08:59question what is going to happen when

4:09:01you make a Constructor as private can I

4:09:04create the object of this particular

4:09:06class yes or

4:09:07no can I create the object of a class

4:09:11which uh has a Constructor as private

4:09:14the answer is yes I can create the

4:09:16object of this particular class but I

4:09:19can only create the object within the

4:09:22class you see build method is creating

4:09:25the sign up requesta object it is

4:09:28calling the Constructor of sign up

4:09:30request within the class what happens

4:09:33when you make the Constructor as private

4:09:35is you take away the privilege of

4:09:38creating the object outside the class I

4:09:41cannot create signup request

4:09:43object now in any other class make sense

4:09:46within the class I will be able to

4:09:48create

4:09:49it are you getting the point over here

4:09:52yes or no are you getting this

4:09:54point yes no are we on the same page

4:09:57everyone okay now because of this this

4:10:01really helps us out because now when

4:10:03I'll be writing any of my test so they

4:10:06have to use the Builder method okay they

4:10:08have to use this Builder Constructor and

4:10:10only then pass it off make sense to

4:10:12everyone you will get the object uh hash

4:10:15code or the instance reference but it

4:10:18has to go via Builder so I cannot write

4:10:20new signup request and start passing the

4:10:22parameter over here which we were able

4:10:24to do it in the previous class now you

4:10:26are not going to do it so please make

4:10:28sure if someone ask you in the interview

4:10:30can the Constructor be private most of

4:10:32the people are going to say yes and in

4:10:34which design pattern most time people

4:10:36say it's going to be single time it is

4:10:38partially true you should also make it

4:10:41uh private in your Builder classes is

4:10:44this part clear to everyone yes or no

4:10:47are we on the same page now right can I

4:10:51go

4:10:58ahead now over here comes the next part

4:11:01that is we want to generate logs okay

4:11:04this is something that we want over here

4:11:06generate the logs in your um automation

4:11:10framework now obviously you will be

4:11:13using the log 4J Library coming into

4:11:16picture so if I go to your palm. XML

4:11:19file okay and let's say if I go to the

4:11:23overview I have already added this

4:11:25particular dependencies if I go to

4:11:27dependencies there is going to be lock

4:11:294J API and lock 4J core uh nothing fancy

4:11:33over here you guys can generally just go

4:11:36to this particular document from the day

4:11:40three uh you can add these two

4:11:43dependencies the log 4J API and log 4J

4:11:47core this is something that needs to be

4:11:50added when you are generating or you are

4:11:53going to use the log 4J Library both the

4:11:56dependencies are required core and API

4:11:58is this part clear to everyone so this

4:12:01dependency I have already added it in my

4:12:05framework now we are supposed to use it

4:12:08so over here guys we need something

4:12:10which is called as this log 4J 2. exam

4:12:13file once you have added this particular

4:12:15dependency API and core go to the SRC

4:12:19test resource and introduce a file which

4:12:22is called as log4j2.xml I can delete it

4:12:24and I can recreate it for you guys

4:12:26nothing fancy over here just right click

4:12:28create a new uh file the name of the

4:12:31file is not going to change it's going

4:12:32to be log4j2.xml

4:12:34only tell it assignment same stuff now

4:12:37over here guys what are you going to

4:12:39have if I'm going to I I'll start asking

4:12:42questions because most of you have

4:12:43already done this particular stuff if

4:12:45I'm going to talk about log 4 J2 XML

4:12:47file if I have to configure this thing

4:12:49what is going to be required over here

4:12:52what is required in the log 4J to XML

4:12:54file what setups things are need to be

4:12:56required over here that's the

4:12:58appender nothing

4:13:01else what exactly will be required over

4:13:04here the the structure I'm talking about

4:13:08so the point that is over here is the

4:13:11first thing that you want to talk about

4:13:14a wow file when I'm looking at the

4:13:17structure okay just give me a moment

4:13:20when you're looking at the structure the

4:13:22first thing that you need over here is

4:13:24the configuration and inside the

4:13:26configuration you are going to have

4:13:28appenders and loggers so it's pretty

4:13:32simple okay though you can just copy

4:13:34paste it it's not really a big thing but

4:13:36obviously if you're copying copy and

4:13:38pasting it also you need to know why you

4:13:40creating certain things so just remember

4:13:42you have something which is called as

4:13:44configuration the first thing the no

4:13:46node basically starts from configuration

4:13:49you're supposed to give this particular

4:13:50configuration Sor just give me a moment

4:13:53please don't draw whoever is drawing on

4:13:55the

4:13:56screen

4:13:58okay okay so the first thing that you're

4:14:01going to give is the configuration and

4:14:03you can give a name you can give a

4:14:04status so you can just going to call

4:14:06this as status is going to be let's say

4:14:08as warning okay and this particular

4:14:11configuration is going to have something

4:14:13which is called as appenders okay

4:14:16something called appenders now in your

4:14:19log 4J we technically need two kinds of

4:14:22appenders what how many kinds of

4:14:24appenders two kinds of appenders one is

4:14:27going to be what what what kind of

4:14:29appender first one is going to be

4:14:31console based appender so you see inside

4:14:34appender we have console based appender

4:14:36and the second one that I need is

4:14:38basically the file based appender coming

4:14:41into picture so I'm going to just say

4:14:43console okay and I'll have the

4:14:45configuration of console and the second

4:14:48one is going to be the file based

4:14:50appender which will be there now you'll

4:14:51be thinking what exactly is this

4:14:53appender and all see when my logs are

4:14:56going to be generated where do I want to

4:14:59showcase my logs as simple as that

4:15:03log so my logs I want to show it on the

4:15:06console I want to see it on the

4:15:09execution along with that I want a file

4:15:13to be created which is going to be that

4:15:15is going to be the file based appender

4:15:17log file so the configuration takes care

4:15:21of where this appender needs to be shown

4:15:24is this part clear to everyone so I'm

4:15:26telling that for this framework this

4:15:28particular project I will need two kind

4:15:31of appenders coming into picture the

4:15:32first one is going to be the console

4:15:34based appender and the second one is

4:15:36going to be the file based appender is

4:15:39this part clear to everyone yes or no

4:15:43yep so don't uh you know like whenever

4:15:46you have to explain like in the

4:15:47interview also right answer it in this

4:15:49structure only if I'm going to have a

4:15:52log 4J I need the configuration the

4:15:54configuration is going to have appenders

4:15:56and loggers we'll just focus on

4:15:58appenders for now now rest of the stuff

4:16:01is pretty simple you just give a name to

4:16:03this particular appender I'm just going

4:16:05to call it what is written over here

4:16:06console I'll take the same name for your

4:16:08reference so this going to be console

4:16:10based appender just that's just the name

4:16:12we need over here and the next thing

4:16:14that comes into picture is something

4:16:16called as Target you write

4:16:18system.out.print l so that's what you

4:16:20need to write system underscore out as

4:16:22simple as that okay so I'm just going to

4:16:24say uh

4:16:30Target just write in capital system

4:16:33uncore out okay we'll come to the

4:16:35pattern layout later same I'm going to

4:16:37do it for file also so I'm going to say

4:16:39this is going to be a file based

4:16:41appender so the name I'm going to give

4:16:43file okay so just going to write over

4:16:45your file okay and the next thing that

4:16:48comes into picture is file name so this

4:16:51file log will be created where it is

4:16:54going to be created inside logs forward

4:16:57SL test log file that will be the name

4:17:00of this particular uh log file so I'm

4:17:03just going to say over here as file name

4:17:05the convention is same like your Java

4:17:07camel casing and I'm just going to say

4:17:10log create a log folder

4:17:13inside that logs folder create a file

4:17:16called uh test.log as simple as that is

4:17:22this part clear to everyone so one the

4:17:25logs will be shown on my console second

4:17:28the log 4J is going to create something

4:17:30which is called as this um logs folder

4:17:33which we don't see it anymore over here

4:17:35it's going to create that folder for us

4:17:37inside that test log file will be there

4:17:40is this part clear to everyone yes or no

4:17:44are we on the same

4:17:45page

4:17:48okay next

4:17:50thing but once these logs are generated

4:17:53what needs to be shown log

4:17:57F right that is where pattern layout

4:18:00comes into picture okay so you're going

4:18:02to create something which is called as

4:18:03pattern layout what will be the

4:18:06structure okay how this particular stuff

4:18:09will be shown okay so we'll discuss

4:18:11those things in a moment I'm just going

4:18:12to say pattern layout and this same

4:18:14pattern layout I'll be creating

4:18:17here this pattern layout my dear friends

4:18:19is going to have a pattern okay so this

4:18:22pattern layout you need to create

4:18:25something which is called as a pattern

4:18:27so I'm just going to copy this and I'll

4:18:28explain you one by one line so over here

4:18:31let's say this is going to be a

4:18:33pattern and pattern the first thing I

4:18:35want is the time

4:18:37stamp that is I want to know at what

4:18:40particular time the entire log was

4:18:43created okay that is something that I

4:18:46need so you show it with percentage D

4:18:49okay percentage D this percentage D okay

4:18:54I can configure it if I'm just going to

4:18:56leave it like this okay just give me a

4:18:59moment I can take a better

4:19:05one yeah if I'm going to take this

4:19:08percentage D what is going to happen

4:19:11it's going to go with its own

4:19:13configuration of showing Tim stamp but I

4:19:16want to control in it way I want so I'm

4:19:18telling first show me hours then show me

4:19:22minutes then show me seconds okay and

4:19:25then the remaining seconds so this is

4:19:27how it is going to be shown I can just

4:19:29copy this particular stuff okay and I

4:19:33can keep it over here is this part clear

4:19:36to everyone same I can do it over here

4:19:38also so pattern equal to this

4:19:43so it is now if I run this particular

4:19:45stuff only thing that I will be able to

4:19:47see is the time

4:19:48stamp but I don't need just the time

4:19:50stamp now I need other information also

4:19:53the next thing that is there over here

4:19:54is something called as percentage T so

4:19:58this is basically the thread name which

4:20:00is coming into picture okay which thread

4:20:04is getting executed over there okay so

4:20:07since if if you are going to have

4:20:09something called as let's say parallel

4:20:10execution so which thread it was running

4:20:13it is going to give me the thread name

4:20:15if you are only going to do sequential

4:20:17execution let's say you just want to do

4:20:19an end to end testing in one shot so

4:20:21single thread will be needed that time

4:20:23so only main will be written over there

4:20:25is this part clear so this percentage t

4:20:28means your thread name coming into

4:20:31picture so square

4:20:33bracket the answer is no this is the

4:20:37pattern

4:20:39sareet okay so if I would have left per

4:20:42percentage uh percentage itself

4:20:45percentage T itself then it would have

4:20:47shown me in that format only but if it's

4:20:48going to be in square now square

4:20:51bracket okay so this is something that

4:20:53we are controlling it off so this is

4:20:55going to just give me the thread name

4:20:58okay so I can just attach this chap over

4:21:00here and I can attach this chap over

4:21:02here okay both the places your pattern

4:21:06layout will be exactly the same you're

4:21:08not going to change it anywhere because

4:21:09whatever is generated on the console I

4:21:11want to see it on my file

4:21:13the next thing that comes over

4:21:15here SS microc seconds like you want to

4:21:18go it off over there but I will suggest

4:21:20you don't keep it off if you want SS Tu

4:21:22is fine hours minutes seconds and okay

4:21:25that's the level so next thing is the

4:21:28level whether it is a informational log

4:21:30whether it is a debug log whether it is

4:21:32a warning whether it is an error all

4:21:34those levels will be shown to you so

4:21:36whatever is the level you take it off

4:21:39and you attach it off over

4:21:41here see I'm going to do it over here

4:21:45done okay so over here whether it is a

4:21:50informational log whether it is going to

4:21:52be a debug log whether it is going to be

4:21:54a warning all those things will be shown

4:21:56to me the next thing which comes over

4:21:58here is something which is called as

4:22:01percentage logger if you remember if

4:22:04anyone remembers what exactly percentage

4:22:05logger is going to give me and 36 over

4:22:08here is a length what is the percentage

4:22:10logger signifies over here percent

4:22:12percentage logger basically is going to

4:22:14give me the class name from which class

4:22:17this particular log was getting

4:22:20generated it is going to give me the

4:22:22class name exactly the class name which

4:22:24is going to be there con class me

4:22:28message a okay so percentage logger is

4:22:31going to give me the class name

4:22:33percentage message is going to give me

4:22:34the message that I'm trying to print and

4:22:37percentage n once this entire stuff is

4:22:40going to be printed it is going to go to

4:22:43the next line percentage n signifies

4:22:46print the log and go to the next line is

4:22:48this part clear to everyone yes or

4:22:52no are we on the same

4:22:57page

4:23:02now just to repeat it this is going to

4:23:05give me the Tim

4:23:08stamp this is going to give me the

4:23:11thread name

4:23:13name if it is going to be a single

4:23:15threaded one main will be written this

4:23:18is going to be the level info dbug

4:23:20whatever it is going to give me that

4:23:21stuff this is going to be give me the

4:23:23class name you're going to get the fully

4:23:26qualified class

4:23:28name then this is going to be the

4:23:30message that you're trying to print and

4:23:32percentage n is going to go to the next

4:23:36line clear so this is the pattern this

4:23:39is how I'm telling log 4J Baba I want

4:23:42the output in this format one it is

4:23:44going to print it on the console and the

4:23:46second one it is going to write it in

4:23:48the file is this part clear to everyone

4:23:51yes or no did you create understand this

4:23:54entire structure what I have created so

4:23:56far okay this is not something that

4:23:59people will tell you to write it in the

4:24:00interview and all but you know like they

4:24:02can always ask

4:24:04structure okay so the next thing that

4:24:07comes into picture is up the final thing

4:24:09comes into picture is logger okay so

4:24:12this is something that you really don't

4:24:14want to change change it off percent

4:24:16this is basically hyphen 5 is the

4:24:19padding hyphy is like if you have info

4:24:23debug your warning in words

4:24:26characters so if I want to just make

4:24:28sure that the padding the spacing is

4:24:30correct and all that's the reason

4:24:31percentage five minus 5 is written over

4:24:34there okay so that's the reason even if

4:24:36you remove it off the output will still

4:24:38be there the only thing is

4:24:40spacing okay

4:24:44and once this is done you will introduce

4:24:45the logger skaba you are telling logger

4:24:48then start using it off over here so

4:24:50just copy and paste it off nothing fancy

4:24:51logger the root level is info so I'm

4:24:54telling that capture everything from

4:24:56information level and both the stuff

4:24:59will be shown all the informational

4:25:01message will be printed on the console

4:25:05and it is going to be R uh written on

4:25:07the file clear to everyone this is going

4:25:09to be exactly the same you are not

4:25:11supposed to change anything over over

4:25:12here so from informational message level

4:25:15your console will be shown like the

4:25:17messages will be shown on the console

4:25:19and the file if you're not writing this

4:25:21part it's not going to work okay you

4:25:23just created the appender but logging is

4:25:25not getting started over here so that's

4:25:27something that you have to introduce in

4:25:29the log forg and that's the only thing

4:25:31that you need done finish okay let's

4:25:33close all these things so if you

4:25:35remember we are just focusing on

4:25:38generating the logs so we got this thing

4:25:40into picture

4:25:42now I want to know I want to generate

4:25:46the logs what exactly the information

4:25:48will be there in the logs which test got

4:25:51started which test got failed which test

4:25:55got skipped when the test was executed

4:25:58when the test got finished who is

4:26:01responsible for all these things who is

4:26:04responsible for all these things in your

4:26:05automation framework who can take care

4:26:07of all these things

4:26:12how do I come to know when the test is

4:26:13started when the test is failing when

4:26:15the test is getting

4:26:22skipped listeners listeners will come

4:26:26into picture you have saw the assignment

4:26:28guys come

4:26:29on what assignment you guys are solving

4:26:31over here package so I'm going to create

4:26:34over here a new package which is called

4:26:36as com. api.

4:26:40listeners okay now now the next thing

4:26:43that comes into picture is I'm going to

4:26:44quickly create a class and I'm going to

4:26:47call this particular class as my test

4:26:49listener

4:26:51finish okay this story Remains the Same

4:26:55this particular class is going to

4:26:56implement which

4:26:57interface which interface is going to

4:27:00come over here public class test

4:27:01listener will Implement which interface

4:27:03first I need input from everyone I test

4:27:06listener

4:27:08implements I test listener

4:27:13okay now you see I'm not getting any uh

4:27:16method overriding request and all

4:27:18because we are using a different version

4:27:20over here of test NG and over here they

4:27:24are using something which is called as

4:27:25the default method so the only benefit

4:27:28that you get is whatever the methods you

4:27:30want you can introduce it from here okay

4:27:34so what I want right now is I want the

4:27:37on start method I'm going to copy it

4:27:39paste it off over here

4:27:42okay paste it off over here just going

4:27:46to call this as

4:27:47public okay control shift

4:27:51F previously you are supposed to

4:27:54implement all the methods now you don't

4:27:56need to do all those things okay so I

4:27:58got on start then I Want U on test

4:28:03success one by one you're going to copy

4:28:05whatever the methods you need make it

4:28:09public next just give me a

4:28:16moment then I want on test

4:28:24failure then I want a test which is

4:28:27going to get

4:28:31skipped so on start on test success on

4:28:35test failure on test skipped and finally

4:28:39I don't want on test build within uh a

4:28:42certain timeout I don't want that I just

4:28:44want this on test

4:28:46finish okay so these methods I'm looking

4:28:49for so I'll just add it off over here is

4:28:52this part clear to

4:28:54everyone we have done it a lot of

4:28:57time

4:29:00clear yes no can I go ahead

4:29:03quickly okay

4:29:06now we have to introduce the

4:29:10logs so over here guys if you want to

4:29:13use the log you will use something which

4:29:17is called as logger and log manager okay

4:29:20so if you look carefully test listener

4:29:21Implement side test listener and I have

4:29:23this particular snippet which is there

4:29:26so whenever you're generating a log okay

4:29:30your code is going to look something

4:29:31like this private static final okay I'm

4:29:34using logger okay so I'm going to create

4:29:36a reference of logger and log manager.

4:29:39getet logger so over here you supposed

4:29:42to pass the class name okay so whatever

4:29:47the logs which will be generated over

4:29:49here is going to be from the test

4:29:50listener log that's what we are trying

4:29:52to say over here so just do a control

4:29:56space and over here you see I'm getting

4:29:59logger from lot of different packages in

4:30:01Java you are supposed to use the one

4:30:04which is an interface org. Apache

4:30:07logging log4j you're supposed to use

4:30:10this one and log manage

4:30:12you are going to use this chap from the

4:30:15log 4 J1 be careful don't select

4:30:17anything else okay it's not going to

4:30:19work then

4:30:21done save it

4:30:24now over here we wanted to generate the

4:30:27log so I can just say over here logger

4:30:30doino and I just want some kind of a

4:30:33message to be printed over here okay so

4:30:37the message can be something like uh

4:30:40test Suite

4:30:44started okay copy this and over here

4:30:48this is going to be onfinish method so

4:30:50I'm just going to say complete

4:30:52it save it copy this now over here my

4:30:56dear friends I want to give the test

4:31:00name so we see this it test result

4:31:02variable now we're going to use that

4:31:03only I'm going to copy this I'm going to

4:31:06say result. getet method name

4:31:16and I'm just going to see over here

4:31:19something like

4:31:23this

4:31:26started okay and then I want to probably

4:31:29have the description of this particular

4:31:33stuff okay I'm just going to

4:31:38say get the

4:31:40description finally the test uh this is

4:31:43not finished this is on

4:31:47start this is going to be passed sorry

4:31:50this is Success no okay this is pass and

4:31:54I'm just going to copy this put it over

4:31:56here this is going to be for

4:31:59failure I'm just going to see the test

4:32:01has

4:32:02failed okay and I just say this is going

4:32:06to be skipped something like this now

4:32:10obviously if a test is failing it is not

4:32:13something which is a info right so you

4:32:16can use something let's

4:32:18say if I go over

4:32:24here I can go for a fatle message

4:32:27something like this because just

4:32:28indicating that this is something which

4:32:30is a major problem okay or you can just

4:32:32use the normal error popping up into

4:32:35picture okay so I can just go for

4:32:38error okay and this is just going to be

4:32:41an info that the test got skipped now

4:32:44one method I have missed over here on

4:32:46test success is there I need one more

4:32:49which is on test started this one okay

4:32:55so I'm just going to copy this and I'm

4:32:56going to introduce this also over

4:33:00here and change the method you know like

4:33:03from default to public just copy this

4:33:06line paste it over here copy this put it

4:33:10off over here I'm just going to say test

4:33:12started okay so I don't need the

4:33:15description over here is this part clear

4:33:17to everyone what I've done over here

4:33:20this is how I've generated the logs in

4:33:21the previous classes also clear to

4:33:24everyone nothing fancy to have done over

4:33:26here as

4:33:28such everyone any no rocket science over

4:33:32here just copy paste copy paste keep on

4:33:34changing the things over here now once

4:33:37this is

4:33:38done uh what I want to do is I want to

4:33:40go to the API test

4:33:42and we're going to take a very simple

4:33:43test over here let's say we decide to go

4:33:46for something like login API test 3

4:33:48itself like something very basic I want

4:33:51like I don't want any fancy things this

4:33:53is the one I want to attach the test

4:33:56listener to this particular test class

4:33:59how do I do that which annotation will

4:34:01come into picture if I want to attach a

4:34:03listener to this particular class what

4:34:05will I use over here which

4:34:07annotation at theate

4:34:10listener and you're going to give com.

4:34:12API

4:34:14listeners. test listener.

4:34:17class okay like if everything works in

4:34:21our

4:34:22favor okay and if I run this particular

4:34:31stuff can you

4:34:36see the logs are getting

4:34:39generated it's a information na log com.

4:34:43API test listener test. started started

4:34:47login test description verify if login

4:34:50API is working right this is the

4:34:53response which I'm getting back okay and

4:34:56if I refresh this particular project I

4:35:00should see a logs folder inside the logs

4:35:03folder I'll see the

4:35:05logs is this part clear to

4:35:08everyone yes or no

4:35:12yes

4:35:13no everyone on the page uh we call yes

4:35:16no are we on the same page

4:35:19guys this is something similar we have

4:35:23done in the

4:35:25past so if this was something that we

4:35:28have done similar in the past the class

4:35:29should end over here right but the class

4:35:31starts now okay the the thing over here

4:35:35guys is if you look carefully what is

4:35:37missing in this log if you look

4:35:40carefully is is the log enough is it

4:35:44solving the entire stuff whatever you

4:35:46were looking for the answer is no if I'm

4:35:51looking at the log shouldn't it be great

4:35:54if I am able to see the payload I'm able

4:35:57to see the end point I'm able to see the

4:36:00response I'm able to see the header

4:36:02right I'm able to see the status code

4:36:04coming into picture

4:36:13getting the point that's something which

4:36:14I want over here that I can rely it on a

4:36:17much

4:36:18more like it it gives you more detailed

4:36:21information as simple as that

4:36:24but how to do that so over here if you

4:36:28look carefully if you look at the login

4:36:30test how do I pass the Header

4:36:33information how do I pass this base URI

4:36:36the body the response status code

4:36:40information test

4:36:42response reest how do I capture it off

4:36:46some way and I can give it to this

4:36:49particular listen now are you getting my

4:36:52problem yes no how can I take the

4:36:55payload from there and I can give it to

4:36:57over here some people will say that you

4:36:59use the result make sense

4:37:02result but

4:37:05result I can only access the information

4:37:08which is about the test I cannot access

4:37:11something which is inside the test

4:37:14method are you getting the problem you

4:37:17can access the information of the test

4:37:19the description the status code the

4:37:22group sorry the description uh the test

4:37:25name the groups that they belong to

4:37:27Priority I can get all those

4:37:29informations when the test started when

4:37:31the test got completed all those

4:37:33information I can get from this at

4:37:35theate test annotation if I decide to

4:37:38use this I test result that's the reason

4:37:41reason I got method name that's the

4:37:42reason I got get description and all but

4:37:46what about these

4:37:47chaps right how do I

4:37:51get right how do I get the information

4:37:56how do I get the status code are you

4:37:58getting the problem over here yes

4:38:01no yes no that's that's the most

4:38:03important thing first thing the problem

4:38:05needs to be understood by everyone what

4:38:06I want and like what I'm not able to do

4:38:09right now okay

4:38:12this is the major problem that we have

4:38:15now to overcome this particular problem

4:38:17the term that is coined is something

4:38:19which is called as

4:38:22interception okay the term that is

4:38:24pointed over here is

4:38:27interception so before I write this

4:38:29particular code write code difficult you

4:38:33thinking like what this diagram I made

4:38:34it and all it's not difficult okay you

4:38:37need to understand something what is the

4:38:39meaning of intercepting see

4:38:43intercepting is basically a software

4:38:46term it basically means catching or

4:38:48interrupting something while it is

4:38:51moving from point A to point B okay

4:38:55similarly when you try to intercept a

4:38:57passing of a football you know like two

4:38:58play players are playing football and

4:39:00someone comes in between and take the

4:39:01football away right it allows you to

4:39:04perform action before letting continue

4:39:07its

4:39:08journey in context of this logging

4:39:11filter code inter uh intercepting means

4:39:15the HTTP request is created by your

4:39:18application before it reaches to the

4:39:20server okay for the further processing

4:39:23before it is going to hit the end point

4:39:26the filter catches it intercepts it and

4:39:31it is going to examine the request

4:39:33modify anything that I want to do decide

4:39:36whether to let go or continue or block

4:39:38it so what we will do over here in this

4:39:45scenario I'll first explain you from

4:39:47here this is going to be my test

4:39:50method inside my test my rest assur code

4:39:53is

4:39:54there okay so when this method is going

4:39:58to be

4:39:59executed Java or rest assured Library

4:40:02will try to make a post request to my

4:40:08server up before it makes the request to

4:40:11the

4:40:12server I will intercept

4:40:15it post

4:40:18request we will intercept

4:40:22it intercept basically means

4:40:25interrupting blocking something for some

4:40:27time or you want to capture something

4:40:29from there or do any kind of a

4:40:33modification okay

4:40:35intercept this interception is going to

4:40:38be done by a special entity

4:40:41in your rest short which is called as

4:40:45filter filter

4:40:49intercept and what exactly it is going

4:40:51to do it is going to intercept your

4:40:53request why it is intercepting your

4:40:56request because in your request you have

4:40:59your header or I'll say you have your

4:41:01base URI you have your header you have

4:41:05your body you have your uh any other

4:41:09information that you're passing over

4:41:11there

4:41:11so I will log these particular

4:41:15information from here so filter is going

4:41:19to help me log the base URI header body

4:41:23while intercepting the request is this

4:41:27part clear to

4:41:28everyone are you getting the point what

4:41:30exactly filter is going to do for us yes

4:41:34no are we on the same page

4:41:44if you look carefully look this

4:41:46particular

4:41:48diagram I have this particular test

4:41:52class this test class is going to make

4:41:54the request now while it is making the

4:41:57request and it is trying to reach to

4:41:59this particular endpoint on my

4:42:02server login filter that is my filter

4:42:06will intercept it it is going to

4:42:09intercept the request it it is going to

4:42:11log the request

4:42:13information the method URI header and

4:42:16payload it is going to be logged over

4:42:18here by the log

4:42:224J is this part clear to everyone yes or

4:42:26no is this part clear to everyone how it

4:42:28is going to go similarly once the

4:42:31response is going to come because you

4:42:34have a filter once the response is going

4:42:36to come again it is going to do the same

4:42:38thing response test case P before the

4:42:43the response reaches the test case the

4:42:45filter is again going to intercept it

4:42:48and it is going to capture the

4:42:50information from the response and it is

4:42:53going to log it for

4:42:55us making sense to everyone what exactly

4:42:58it is going to do it is creating a

4:43:00mediator between your test and the

4:43:05server okay the end point that you're

4:43:07making the request to what data is going

4:43:10to go from the test it is going to

4:43:11intercept capture it put it in the log

4:43:14and then send it for further processing

4:43:16reverse also when the response comes

4:43:18loger filter or logging filter is going

4:43:20to take the data filter it off put it in

4:43:23the log file or on the console and then

4:43:25it is going to give for further

4:43:27assertion this is what interception

4:43:29means is this part clear to everyone now

4:43:34how it is going to work

4:43:41okay so the goal over here it's pretty

4:43:46simple interrupt from your test case to

4:43:50your server before the request reaches

4:43:52the server I will try to capture all the

4:43:54information and log it off that's all I

4:43:57want to do nothing fancy because there

4:44:00is no other way there is no other way

4:44:02you will be able to capture any of these

4:44:04things from your test to The Listener so

4:44:09that's where the new comp component of

4:44:11your framework comes into picture which

4:44:14is going to

4:44:17be the

4:44:20filters in interview they can ask the

4:44:23question what are filters in Java or

4:44:26rest is short and you need to answer it

4:44:29from the basis of interception filters

4:44:32helps you intercept the

4:44:35request okay then the interviewer ask is

4:44:39what is the meaning of interception

4:44:41interception basically means that before

4:44:44I start before I make the request if I

4:44:46want to capture any information maybe

4:44:49for logging purpose maybe for reporting

4:44:52purpose I need to intercept it and

4:44:55that's where filters comes into picture

4:44:58so what I'm going to do is here I'll be

4:45:00creating a class which is going to be

4:45:02called as logging

4:45:04filter loging filter I'm going to call

4:45:06it now what to do with this particular

4:45:09class I don't know

4:45:11so what I will do is I'm going to search

4:45:14for something called as an interface

4:45:17which is called as

4:45:20filters

4:45:22okay loging filter implements filter and

4:45:27I have to add this unimplemented method

4:45:30called filter

4:45:32method so in interview if they ask you

4:45:34tell me the different interfaces that

4:45:36you have used in your project don't just

4:45:38rely on test NG interfaces I test

4:45:41listener I retry analyzer now start

4:45:44remembering filter also from rest short

4:45:47clear to

4:45:48everyone should I start writing the code

4:45:51over

4:45:51here

4:45:55yes yes or

4:45:57no now the next thing that comes into

4:46:00picture making the stuff over here is

4:46:02pretty simple it's not very difficult

4:46:05one what it is going to do logging

4:46:07filter it is going to log things for us

4:46:10right so my dear

4:46:12friends since the job is to do the

4:46:15logging you're going to create another

4:46:17logger over here private static okay

4:46:21final

4:46:26logger logger you're going to take it

4:46:28for log 4J I'm going to call this as

4:46:30logger equal to log manager log manager.

4:46:36get

4:46:38logo okay and just give the current

4:46:40class last name that's

4:46:43it

4:46:45finish because we want to log the

4:46:48request

4:46:50now what we are going to do is we are

4:46:53going to create two

4:46:55methods public

4:46:58void

4:47:00log

4:47:03request okay and since you want to log

4:47:06the request you want to take request

4:47:09specification filterable request uh

4:47:11filterable request specification just

4:47:13take this particular stuff put it over

4:47:15here okay what it's going to do I'll

4:47:18tell you moment and then you are going

4:47:21to take the response coming into picture

4:47:24okay I'm going to create something

4:47:26public void

4:47:29log

4:47:36response okay done response huh not this

4:47:40response

4:47:42just the response Now

4:47:45understand what happens over

4:47:48here what we will do

4:47:50is what we're going to do

4:47:52is I'm going to call the log request I'm

4:47:57going to call the log request and I'm

4:48:00going to pass the request

4:48:02specification this request specification

4:48:05consist of all the information about

4:48:09the request

4:48:11base URL header body all those things I

4:48:16will be able to get it over here so

4:48:19filterable request specification is

4:48:22going to give you the information of the

4:48:24request and what I'm going to do I'm

4:48:25going to say logger the logger which I

4:48:28have created do

4:48:30info okay now

4:48:34observe what do you want to log I want

4:48:37to

4:48:38log uh base URI

4:48:41so I can write something called over

4:48:42here as base

4:48:44URI

4:48:46colon and I can say request

4:48:48specification do get me the base

4:48:52URI is this part clear to

4:48:55everyone what I've written over

4:48:58here yes or no so base URI along with

4:49:02the base URI will be printed for you

4:49:04copy this what do I need next header so

4:49:08I can just say request head

4:49:12header okay just change it over here to

4:49:16get me the

4:49:18header okay copy this what do you need

4:49:22body request

4:49:26payload

4:49:28okay

4:49:32get the

4:49:37body what else you need

4:49:44let's say I think so this this is the

4:49:46enough stuff base Ur you're going to get

4:49:47everything whatever is written over here

4:49:50now once you have made the log request

4:49:51right you see this filter context I have

4:49:54written it in the diagram also P log

4:49:56request call then you have to make the

4:49:59request you have to intercept it I have

4:50:02intercepted it so I only have to make

4:50:04sure that it gets continued so over here

4:50:06I have to say

4:50:08CTX okay dot

4:50:12next and over here just pass the request

4:50:16specification and the response

4:50:18specification next is going to return

4:50:21you the

4:50:23response request B because we have

4:50:25intercepted it now we came in between

4:50:29okay it was going without the

4:50:31interception I came in between to

4:50:34capture the information I'm capturing it

4:50:36off should I just stop over here no I

4:50:38want the request to be continued so I'm

4:50:40just is going to make sure the request

4:50:41is made now this is where your request

4:50:45is going to be

4:50:48executed okay next is going to return me

4:50:51the response

4:51:01oops is my voice

4:51:04audible yeah is my voice

4:51:07audible yes okay there was an issue with

4:51:10my it yeah so I'm just going to have the

4:51:12response coming into picture and if You

4:51:15observe carefully I'm logging the

4:51:16response here I'm logging the response

4:51:19so the response which I'm going to

4:51:21get we have to make sure that this is

4:51:24also logged so I'm just going to call

4:51:26log

4:51:27response pass the response okay and over

4:51:32here the same stuff I have the response

4:51:35I'm just going to take these information

4:51:37put it over here I'm going to say

4:51:39response

4:51:41dot get me the status code so I can

4:51:45write over here status

4:51:48code okay I can say

4:51:51response do get me the body okay so I'm

4:51:56just going to get response

4:51:58body okay I can just say dot pretty

4:52:03print then probably I want response

4:52:06header or something I'm just going to

4:52:08say response header okay okay so I'm

4:52:11just going to get

4:52:13response

4:52:15header

4:52:19okay take this cut it and just put it a

4:52:23little bit up something like this okay

4:52:26so now even the response body will be

4:52:31logged whatever the response you're

4:52:33going to get it will be logged in this

4:52:34test log file so if I just scroll down

4:52:42this is how it

4:52:43looks first I'm logging the request okay

4:52:47then you are going to get the response

4:52:50you're going to log the response and

4:52:52finally just return the response because

4:52:54you have to return response back now so

4:52:56just return the response back for

4:52:58further assertion so response return

4:53:01it's going to be taken to the test for

4:53:04assertion okay that's something that you

4:53:06need to write it off

4:53:08done finish

4:53:11look at this piece of code over here for

4:53:13a

4:53:14moment

4:53:16okay

4:53:18so over here why logging filter is

4:53:21created that is more important you have

4:53:23created the logging filter so that you

4:53:26can capture the request payload as well

4:53:29as the response is this part clear to

4:53:31everyone what is filter going to do it

4:53:34is going to do the interception it is

4:53:36going to intercept your request so that

4:53:38it you can log

4:53:41the request information as well as you

4:53:44can log the response information in your

4:53:46logs okay not only just in logs even in

4:53:49your HTML files and all you have to do

4:53:51it this way itself okay so logging

4:53:55filter is going to implement the filter

4:53:57here you are going to create the log

4:54:00okay then you're going to have the

4:54:01filter method coming into picture make

4:54:03sure that you are creating two methods

4:54:07called log request and log response and

4:54:10you I just going to print the log

4:54:11information over here is this part clear

4:54:13to everyone are we on the same

4:54:17page this is very

4:54:21important

4:54:24done now how do I use it into my test

4:54:28scripts

4:54:29okay basically filters are something

4:54:32that you need to set up to the base

4:54:34service so you're going to go to the

4:54:36base

4:54:37service where we are using rest is short

4:54:41you're going to

4:54:44say rest

4:54:51assured dot

4:54:55filter you have to attach a filter over

4:54:58here so you will create the object of

4:55:00logging filter

4:55:03done now this setup needs to be done

4:55:06only once once your program get executed

4:55:09you don't need need to do it again and

4:55:11again I don't want to put it inside the

4:55:13Constructor because if I'm going to do

4:55:15the parallel execution Constructor

4:55:19call but I want this particular

4:55:21execution to happen only once is there a

4:55:24Java entity that can help me execute

4:55:28this code block only

4:55:31once yes or no is there a Java entity is

4:55:35there a Java concept that can execute

4:55:38this code block only once

4:55:40static block right so if you're going to

4:55:43make something in a put something in a

4:55:46static block it will be executed only

4:55:49once all right and it is going to be

4:55:51available for everyone you're done

4:55:54filters are introduced in your project

4:55:57so if everything works correctly the way

4:55:59we are expecting if I click on the play

4:56:02button okay

4:56:11if I go to the test

4:56:18log is this part clear to

4:56:22everyone

4:56:24okay I'm able to

4:56:26see the entire stuff the way we

4:56:29wanted clear this is the payload this is

4:56:33the status code everything whatever you

4:56:38wanted okay

4:56:41this is

4:56:43important

4:56:46okay

4:56:49now we have introduced the final stuff

4:56:52the logging that we wanted over here now

4:56:56we have created a lot of things to be

4:56:58honest this is a this particular

4:57:00framework has a lot of components over

4:57:02there and it's doing a decent job for us

4:57:04the next thing that probably I want is I

4:57:06want to run this particular test from

4:57:08terminal why would I want to run this

4:57:10particular test from terminal what is

4:57:11the benefit that I'll get if you're

4:57:13going to run this particular project

4:57:14from terminal the benefit is benefit is

4:57:18I can easily integrate it with GitHub

4:57:20actions I can easily integrate it with

4:57:22your CI tools the main goal is to never

4:57:25run it from eclipse the main goal is to

4:57:27find a way to run it from the

4:57:29terminal so over there guys I will be

4:57:32using your special plugin which is

4:57:34called as your Maven Shire plugin do you

4:57:37remember the maven Shire plugin yes or

4:57:40no what exactly Maven Shire plugin is

4:57:43going to do so Maven Shire plugin is

4:57:46going to help us run the test okay from

4:57:50the terminal I can control the execution

4:57:52from Maven itself but before that I want

4:57:55to make sure that a test n XML file is

4:57:58created a suit XML file is created over

4:58:00here so you don't really need to byart

4:58:03any of the scripts over here just go to

4:58:04the test take this fail. XML file put it

4:58:07outside because it has the exact

4:58:10structure that we need I'm just going to

4:58:12change the name of the test suit name

4:58:14I'm going to give this as API test

4:58:18Suite okay and uh nothing I don't need

4:58:23this environment information we can

4:58:26remove it okay this is going to be the

4:58:30test name is going to be just like

4:58:35API test we are just executing this

4:58:39particular class

4:58:40done okay so if you're going to have

4:58:42respective you're going to have other

4:58:43classes you can just arrange it over

4:58:45here you know how exactly testing gxml

4:58:47file works all right so this is

4:58:49something that we have created and kept

4:58:52I'm going to save it over here something

4:58:53is missing yeah yes

4:58:56yeah save

4:58:58it was it a difficult thing you you know

4:59:01right how exactly this file gets created

4:59:03right so I'm going to right click over

4:59:05here I'm going to right click rename

4:59:08this particular file

4:59:11and I'm just going to call this as suit.

4:59:13XML file done clear

4:59:18everyone now go to the pom.xml file and

4:59:22over here we will be introducing a

4:59:24plugin in the build

4:59:26section create a build tag inside the

4:59:29build tag you're going to have

4:59:31plugins okay and we will be introducing

4:59:34your Maven sh fire plug-in so scroll

4:59:37down take this Maven sh fire plugin just

4:59:41copy this entire stuff

4:59:43copy paste it off change the path

4:59:48okay save

4:59:50it

4:59:52okay now the thing

4:59:55is I have parameterized it dollar suite.

5:00:01XML file this is what I'm writing over

5:00:03here meaning I have to pass the file

5:00:07name I have to pass the file name from

5:00:11the terminal if you write over here

5:00:13directly site. XML file it is going to

5:00:15run this chap only but I know that there

5:00:18might be a scenario I will have multiple

5:00:21XML files I will create one for

5:00:23regression one for smoke one for sanity

5:00:27okay or one for e2e something like that

5:00:29I can do it off so that time guys I want

5:00:32to pass the file name from the terminal

5:00:35so this is something that we have

5:00:38created okay now now there is one more

5:00:41extra thing that we are supposed to do

5:00:44we are using Java version 11 right we

5:00:47are using Java version 11 so what you do

5:00:50in this scenario is you also add the

5:00:53compiler version that is going to be

5:00:55important so I'm just going to take

5:00:57something called the maven compiler

5:00:59version this is just so that you're

5:01:02telling Maven that your project needs to

5:01:03be compiled against a specific version

5:01:07of java okay so here if I write 1.8 it

5:01:11basically means Java

5:01:178 is this part making sense to

5:01:20everyone yes or no perfect can I go

5:01:26ahead Yep this is something mandatory

5:01:29you have to put it off okay don't mug up

5:01:31code you need these things in the setup

5:01:33all right save this particular stuff and

5:01:36you're done the project is ready now if

5:01:38I just minimize this chap

5:01:41right click over here to your project go

5:01:43to show in system

5:01:48Explorer

5:01:52uh just going to say kit bash

5:01:56here and over here how do you execute

5:02:00this project Maven

5:02:03lean test hyph D what was the variable

5:02:08name over here this is the variable name

5:02:11dollar sweet not sweet is the name of

5:02:13the variable name so I'm going to say

5:02:14equal to Sweet because my file name over

5:02:18here is sweet. XML so just hit enter I

5:02:22could have written hyphen

5:02:32X yep exactly the

5:02:35same are you getting the point I did not

5:02:38change anything what we have done in

5:02:39tell it exactly the same I have

5:02:41configured it for you guys is this part

5:02:44clear to

5:02:46everyone how to pass environment from

5:02:49command

5:02:50prompt for that also you can you need to

5:02:54create property files and all those

5:02:56things I've already covered it off in

5:02:57the tell it part so you can really watch

5:03:00that particular stuff it will be much

5:03:02more easier so you have to create

5:03:03property files and even that property

5:03:05files I need to configure it over here

5:03:07that I'll be getting those parameters

5:03:09and from the parameters it is going to

5:03:11go to the XML file it's going to take a

5:03:12little bit time to set up that's the

5:03:14reason I'm telling you to watch it from

5:03:15The Tell it one it will be easier okay

5:03:18but this it's going to be exactly the

5:03:20same like if I'm writing it over

5:03:22here

5:03:24okay if I clean this particular stuff or

5:03:26you know like I just run the stuff I'm

5:03:28passing one parameter called Suite okay

5:03:32that's the name of my file so I can have

5:03:34another parameter called environment and

5:03:37I can give over here QA right so there

5:03:40should be a a way to handle it off on my

5:03:43framework okay that I have already

5:03:44covered it off in the

5:03:46T now this is done

5:03:50okay now it's the time to push this

5:03:53particular project in your GitHub so the

5:03:57first thing I'm going to do is I'm going

5:03:59to convert it into your git repository

5:04:03so I'm going to say share

5:04:06project create the repository finish

5:04:10now over here guys don't jump into

5:04:12committing all these things in one sh

5:04:15right we have created a lot of things

5:04:17and some of these things are not

5:04:19mandatory over here what is not

5:04:22mandatory or what is not something that

5:04:24you want to commit anything that is

5:04:28autogenerated am I generating test out

5:04:31have I written test hyphen output PR is

5:04:34is this particular stuff created by me

5:04:36or is it

5:04:38autogenerated Auto generated so

5:04:40something which is autogenerated you

5:04:42will always

5:04:45ignore next Target folder I have not

5:04:49done anything for this chap so I'm going

5:04:51to right click go to Team ignore you see

5:04:55number of files are getting reduced now

5:04:58then logs we did not create the logs I

5:05:01have written the code but this is

5:05:03autogenerated team

5:05:06ignore and we are done we have created

5:05:0920 six files okay I'm going to bring all

5:05:12the files into the staging area and I'm

5:05:14going to say this is my base code then

5:05:16I'm going to say

5:05:18commit now we going to go to your git

5:05:21Hub we are going to quickly create a new

5:05:27repository I'm going to call this as

5:05:29demo API

5:05:32automation

5:05:34framework copy this put it here also I'm

5:05:38just going to make it as a

5:05:40public repository create a repository

5:05:42over here uh copy this particular stuff

5:05:45copy the remote repository URL push

5:05:54it done okay so if I close it go back

5:05:59over here refresh it the code is here is

5:06:04this part clear to

5:06:06everyone is this part clear to everyone

5:06:14are we on the same page

5:06:17guys

5:06:20everyone now suppose if this was an

5:06:23interview question will I just stop over

5:06:25here the answer is no you have to make

5:06:29sure that you integrate it with the CI

5:06:31tool also so I'm just going to go with

5:06:33GitHub actions over here I'm going to go

5:06:35to GitHub actions this is a Java based

5:06:37project

5:06:39okay there are lot of uh stuff that I

5:06:42can easily search for the workflow for

5:06:44related to Java or Maven okay but I feel

5:06:48I can easily do the initial setup but if

5:06:50you want you can just search for Java

5:06:53Maven hit

5:06:55enter okay and uh you're going to go

5:06:58with something which is called as Java

5:07:00with

5:07:03mavin and it basically gives you the

5:07:06basic setup things which you require

5:07:08over here for execution we can we'll use

5:07:11this only and I'll modify changes over

5:07:12here I'm going to say Comm at this

5:07:14changes or not right now we'll modify it

5:07:18off first let's remove these

5:07:22things

5:07:24okay and uh the first thing I'm going to

5:07:28give over here is the name I'm going to

5:07:30call this as API

5:07:32testing let's say API test framework

5:07:40next we are going to set up Java

5:07:4511 this is going to check out the code

5:07:47this step is going to check out your

5:07:49code this step is going to set up Java

5:07:51Java L uh so jdk 11 I've written over

5:07:55here and just change 17 to

5:07:5711 and over here rest of the stuff is

5:08:01fine this is where you will be writing

5:08:03your command so I'm just going to

5:08:06say

5:08:08execute test

5:08:11and I'll write the command over here

5:08:14Maven clean test

5:08:19hin um D sweet equal to the

5:08:26sweet and just give hyphen X remove

5:08:29these things this is

5:08:31optional is this part clear to everyone

5:08:34just click on Commit changes okay commit

5:08:38It Off

5:08:41and I'll just wait for this particular

5:08:43stuff to get

5:08:45started okay if I go to actions it's

5:08:48getting

5:09:07executed does it look fam

5:09:10C I've executed a test from your ci2

5:09:15clear the basic setup basic bare minimum

5:09:18setup that I've done over here okay just

5:09:20changed couple of things and it is

5:09:21running okay but if I want to take it

5:09:24little bit further you know if you have

5:09:27a lot of other options coming into

5:09:29picture that is something that we can do

5:09:31now once I have this particular y uh

5:09:34Maven yl file created I want to let's

5:09:37say make few changes over here so that

5:09:39we can set up the crw I want to run the

5:09:41test on a certain time span or uh you

5:09:44know like I want to Archive reports and

5:09:46all those things we will do now

5:09:49so on the poll request the next thing

5:09:52that I want over here is to have

5:09:54something called as a schedule okay and

5:09:57I will have a cron coming into picture

5:10:02so the cron will look the cron format if

5:10:06you remember is um the five star I I

5:10:09want to run the test at 11:30 p.m.

5:10:14IST okay so if I want to run the test

5:10:1711:30 p.m. IST the scheduler is always

5:10:21going to look at what what time which

5:10:24time is going to be taken into

5:10:26consideration yes which time it takes

5:10:29over here UTC time the time which you

5:10:32always give is going to be the UTC time

5:10:35so you have to make sure that you do UTC

5:10:37to IST converter

5:10:39okay so just give me a

5:10:55moment so just go to Google and search

5:10:58for UT C2

5:11:00IST

5:11:03converter okay and over

5:11:06here you know you just give let's say I

5:11:10want to run it at 11:30 p.m. so if I my

5:11:13goal is to Lear run it at 11:30 p.m. it

5:11:16should be executed at 6 p.m. that is

5:11:21180 okay so this particular stuff I'm

5:11:25using it as a reference and over

5:11:28here what I can do is I just need to

5:11:32make just a small

5:11:34change this particular cro okay you are

5:11:39supposed to give the time in 11:30 uh

5:11:42sorry 6:00 p.m. so over here go come

5:11:45back over just change it and I'm just

5:11:47going to

5:11:49say 6 p.m. so

5:11:5200

5:11:5318 and I want to run every single day

5:11:57every single month every single day so

5:12:02this first

5:12:04star is going to signify your

5:12:10month then it is going to signify the

5:12:12date then it is going to signify the day

5:12:17okay just bringing my cursor over here

5:12:20so it is going to run every single day

5:12:23at 6: p.m. UTC that is going to become

5:12:2811:30 p.m. for me is this part clear to

5:12:32everyone yeah is this part

5:12:37clear I can also set up multiple crons

5:12:40based on my requirement I can have one

5:12:42more field like this and just going to

5:12:45search for let's say I want to so run my

5:12:49test let's say

5:12:53around 8:30 a.m. so I have to make it

5:12:563:00 a.m. so just make it 3:00 a.m. done

5:13:01now this is going to run at 3 a.m. for

5:13:03me that 3 a.m. is eventually going to be

5:13:07how much

5:13:098:30 a.m. for me so before my day start

5:13:13my test will be executed

5:13:16okay the next thing that I want to do is

5:13:18I want to Archive the reports we have

5:13:21done it a lot of time for the upload

5:13:23build artifacts and all so you can just

5:13:24go to this upload build artifacts okay

5:13:27this is the extension or this is the

5:13:30action that you're supposed to use and

5:13:33um it's pretty simple you just give the

5:13:37name upload build artifact then it is

5:13:40going to uses this action copy

5:13:43this

5:13:45okay it's going to use this

5:13:48action the next thing that the

5:13:52indentation is important so just make

5:13:53sure the indentation is

5:13:56proper and over here the width you have

5:13:59to specify with

5:14:02artifact I'm just going to call this as

5:14:04name okay just going to give a little

5:14:07bit space

5:14:09and this is going to be um logs okay and

5:14:15where will I find the logs so you are

5:14:18supposed to give the path okay so over

5:14:21here the default of file path okay and

5:14:24the final thing that I'm supposed to

5:14:25give is the path over here yeah path so

5:14:29it should be path

5:14:32colon we will find the logs in the logs

5:14:36folder so this logs folder folder is

5:14:39already at the root level so just put

5:14:41logs and you're done clear so it is

5:14:44going to Archive the logs for us now I

5:14:47can just commit the

5:14:50changes let's see whether it works the

5:14:53moment you make a change your action is

5:14:56automatically going to be

5:14:58executed okay so if I'm running it again

5:15:00one more time

5:15:15okay so it says upload a build artifact

5:15:18it has done so if I just go back to the

5:15:21framework

5:15:23okay

5:15:25and refresh

5:15:33it here you see the logs file if I

5:15:36download it

5:15:40file got downloaded I can open it this

5:15:44is a test log I will be able to see the

5:15:46logs also is this part clear to

5:15:49everyone are we on the same

5:15:53page people in the call

5:15:55everyone are you on the same page over

5:16:04here okay

5:16:07done no not really in this one I'm not

5:16:10going to use

5:16:11it

5:16:13okay now once uh this is

5:16:18done the next thing that I want is I

5:16:21want to have the extension or I want to

5:16:24use an

5:16:26action which is going to just publish

5:16:29the test reports so you can directly

5:16:32take this particular test report guys uh

5:16:34don't need to worry about anything else

5:16:36there's another act action which is

5:16:38called by dney test hyphen reporter so

5:16:41it is going to look for an XML file but

5:16:44the thing is it only looks for junit

5:16:47reports okay luckily when you use the

5:16:50maven Shire plugin in the test hyphen

5:16:54output folder you find this junit report

5:16:57okay and over here we are

5:17:00interested in reading this test hyphen

5:17:03all these XML files we want to read all

5:17:05these XML files over there okay so so

5:17:09what you can do now is you can just copy

5:17:12this entire

5:17:14plug-in sorry ex action my bad and uh

5:17:19now let's come back over here to

5:17:32actions let's edit it one more time and

5:17:36let's introduce this chap also

5:17:40okay

5:17:41done so over here

5:17:44guys one more important thing even in

5:17:47for your build artifact make sure even

5:17:49if my test is passing or my test is

5:17:52failing you want to make sure that the

5:17:54reports are getting archived or the logs

5:17:56are getting archived so make sure you

5:17:57use if always here also as well as Z

5:18:00also it is going to search for the junit

5:18:03reports okay anything that is going to

5:18:06start with test word you see the name

5:18:09can be different test hyen com. API test

5:18:11account creation forgot password get

5:18:14profile password test so the name can be

5:18:16anything but it should start with the

5:18:17word test with capital that's what I've

5:18:20written over here and one more thing

5:18:22that you want to give over here is the

5:18:24permission so if I come back over up you

5:18:27have to give the permission to read

5:18:29check and U you know like write the

5:18:31issues and all those things so I'm just

5:18:33going to copy this permission just take

5:18:34this part and you introduce it in the

5:18:39after the run on Section okay after the

5:18:41run on you just introduce this Chap and

5:18:44you're

5:18:46done

5:18:52okay okay so what is going to be

5:18:55happening it's it will be able to write

5:18:56all those information on your dashboard

5:19:00so just click on Commit the changes

5:19:02let's save it

5:19:22let's click on

5:19:30details it has published the test result

5:19:32you can see this test NG result section

5:19:35I click over here taada done all right

5:19:40this is something and this is how you're

5:19:41supposed to submit your

5:19:43assignment okay so people who have

5:19:46solved the crisp assignment or you have

5:19:48solved the um Phoenix assignment or if

5:19:52you're doing this assignment also make

5:19:55sure you submit or uh whenever an

5:20:00interview comes into picture they tell

5:20:02you to write API test or they tell you

5:20:04to create an API automation framework

5:20:05you have to do till year and submit it

5:20:07off is this part making sense to

5:20:10everyone this this one is a little bit

5:20:12tricky for sure I mean like because I'm

5:20:14pretty sure you're doing it for the

5:20:15first time okay so I don't expect you

5:20:18guys to know it in one shot like if you

5:20:21look at the previous lecture that has

5:20:23happened it was like we have seen Java

5:20:25Concepts you might be aware of little

5:20:27bit of rest short scripts and all but

5:20:29this really takes it to a little bit

5:20:31bigger level little bit advanced stuff

5:20:34okay but I promise you if you put like

5:20:36two three

5:20:38attempts in doing these things you're

5:20:41done that's the reason I said like you

5:20:44need to be sure that you have solved the

5:20:45Tet assignment people who have solved

5:20:48the T it assignments the only difference

5:20:50over here is of like around 10 15% rest

5:20:53all the stuff was

5:20:54same did I use Shire plug-in over there

5:20:57yes did I integrate it with grub action

5:21:00yes did I use the listener yes did I use

5:21:03the logger yes the only difference that

5:21:05has happened over there is of the filter

5:21:09makes sense to everyone apart from that

5:21:11everything else was

5:21:12same okay that's

5:21:16it not for now bu I have to plan it

5:21:20something on that it will be available

5:21:22on the LMS I don't think I'll be able to

5:21:24take it in the live sessions okay I'll

5:21:27put it off somewhere on the LMS

5:21:30okay so please study from the LMS people

5:21:33who haven't studying it over there uh it

5:21:36should be running over there I don't

5:21:38know which build number is this this

5:21:39build number is three

5:21:41right okay so generally what happens is

5:21:44since it's a free free one right so it

5:21:47should be

5:21:49executing between

5:21:5111:35 okay or 11:25 they try to you know

5:21:54like give you the 11 not exactly on the

5:21:5611:30 it will execute I'll get a message

5:21:58in sometime okay that the build was

5:22:01executed at

5:22:03all okay I'll have to wait you can keep

5:22:07a track over here on this one

5:22:27okay it was executed 4 minutes ago that

5:22:30was because of us only but we'll just

5:22:31have to wait okay

5:22:39how to send automation execution reports

5:22:41on email uh when you use GitHub action

5:22:44you can definitely get the access or

5:22:47notifications directly to whoever have

5:22:50the access to the

5:22:52repository okay so if you give the

5:22:55access to the repository they will get

5:22:57the

5:22:58notifications okay so over there it can

5:23:02work but I think there will be some kind

5:23:03of an extension or an action available

5:23:05for that but then again you need to do

5:23:07the setup of MTP you need to give the

5:23:09creds and all so that's will be a

5:23:12different

5:23:13stuff okay but over here if you give the

5:23:16access to the repository it will you

5:23:17will get the

5:23:23notifications any other questions

5:23:31guys I'll give you the permission to

5:23:33unmute

5:23:41for Jenkins as in what you can ask the

5:23:45question like if you want to do the

5:23:47execution in

5:23:51Jenkins the command will be same there's

5:23:54nothing fancy it's going to change over

5:23:56there in Jenkins you will use you

5:23:58will do exactly same okay you're going

5:24:02to create a freestyle project and you

5:24:04have to just use the command which we

5:24:06have used over there that is this

5:24:07command

5:24:09okay just use this command it will

5:24:12work okay this is something that I was

5:24:15just showing you but this is something

5:24:16that you need to use provided you need

5:24:19to have Maven and Java installed on your

5:24:22server jenin server okay only then you

5:24:26will be able to execute it but looking

5:24:28at the current trends which are

5:24:30happening people might migrate or people

5:24:33have already started migrating from your

5:24:36Jenkins to GitHub actions because it

5:24:39takes away the lot of headache of yours

5:24:41you know like to take care of these

5:24:42executions and all you know like the

5:24:45setup okay I can do everything directly

5:24:47on this uh repository level okay the

5:24:51same is with your GitHub gitlab Runner

5:24:53also

5:25:04okay next question guys any other

5:25:07questions so so jatin uh so are you

5:25:10including this payload creation that

5:25:13complex Json or nested Json and all so

5:25:16because uh that that Jason is only

5:25:20simple which one this one we never

5:25:23really created login response we never

5:25:25really passed the pord if you remember

5:25:27if you look at the screen created that

5:25:29pojo classes for that yeah so we did the

5:25:33same for the response right if you go to

5:25:35close all let me just close this that is

5:25:37for the simple uh request um no not

5:25:40really I'll show you this one the

5:25:44response okay this is for the user

5:25:47profile response but if you were having

5:25:49a nesting also you can just keep on

5:25:51continuing it and creating different

5:25:53pojo objects it's still going to work

5:25:55over there okay the goal is to create

5:25:59understand how to create the pojo

5:26:00classes that's it done okay so in this

5:26:04I'm not able to see

5:26:09the sign up request and all I think so

5:26:10it was just for the one level but if

5:26:12you're going to have multiple levels

5:26:13also you just need to create uh the

5:26:16composition layers coming into picture

5:26:18so nothing great changes off over there

5:26:21you give me a complex Json we can easily

5:26:23create it off over there okay and are

5:26:27you covering that how to because in the

5:26:29API testing data is important so how to

5:26:32get a data from the database you need to

5:26:35use the jdpc connectivity that time okay

5:26:39you will find that part on the LMS right

5:26:41now if you go to the Java part right

5:26:44like post the last lectures of java

5:26:46which I'm aware of they will release is

5:26:48going to be on the

5:26:49jdbc okay it's never about see the thing

5:26:54is when you look at a framework

5:26:57perspective you are looking at from that

5:27:00I need to read the data from database or

5:27:02I want to read the data from Excel I

5:27:03want to read the data from different

5:27:04sources I want to generate the data

5:27:08that is from the testing perspective

5:27:10you're looking it for but eventually

5:27:12you're talking something which needs to

5:27:14be a feature in Java or you want to

5:27:16create a functionality in Java over

5:27:18there so when you're looking it from a

5:27:21database reading data from the database

5:27:23is not the problem how you're going to

5:27:25connect to the database how you're going

5:27:28to create the data access objects okay

5:27:30if you're able to create those things

5:27:31quickly then your job is done and then

5:27:33you have to again do the mapping because

5:27:35if I'm going to read the data from the

5:27:37database I need to map it to the pojo

5:27:40class okay yeah and then that pojo class

5:27:43will be passed to the API request make

5:27:44sense yeah that is something that we'll

5:27:47eventually need to do it off okay that

5:27:51stuff I'll probably try to keep it in

5:27:53the LMS itself okay but it will be there

5:27:56for sure yeah if you add if you will add

5:27:59that is useful for me I do it off over

5:28:02there even for the complex seon see like

5:28:04U I don't have any like right now I I

5:28:07don't see any major payloads over here

5:28:09but the thing is if you have a complex

5:28:12Json or you know like something you want

5:28:13to convert it into pojo you can share it

5:28:15off to me I'll create I'll show you how

5:28:17to create it off over there that's not a

5:28:19big because see right now everything was

5:28:22string okay if tomorrow let's say they

5:28:26say that mobile number is going to have

5:28:28multiple mobile numbers like an array

5:28:30would be there so I have to make sure

5:28:32that this becomes a list okay a list

5:28:34will be created over here okay or mobile

5:28:38number is going to have another Json

5:28:40object inside it then again I have to

5:28:41create another Json object out of it

5:28:44okay I think I have discussed on that

5:28:45part but no problem I'll create it again

5:28:49okay thank

5:28:50you any other questions

5:28:56folks

5:29:02okay any other questions I'm still

5:29:05waiting for this particular chap to run

5:29:07but it's still not waiting for some

5:29:08reason okay

5:29:19yeah abishek Akash all clear

5:29:41other folks any

5:29:55doubts okay so we can stop for today

5:29:58this is something

5:30:01uh you need to practice this part okay I

5:30:04can't uh do anything on this part but it

5:30:06will take time

5:30:08make sure you do it off pretty well you

5:30:10you guys have the notes

5:30:13everyone is the notes available with you

5:30:16all yeah yeah make sure you practice It

5:30:20Off from there okay so that's that's

5:30:25wraps it up for us uh one lecture was

5:30:28remaining about the report creation I

5:30:30mean like if I'm able to create the logs

5:30:33obviously reports will be there right

5:30:36you want the extend report to come into

5:30:40uh I want to take the report section

5:30:45tomorrow but it will require you guys

5:30:50to you know have a little bit Clarity on

5:30:54extent report working and all because

5:30:55that time you need to have

5:30:59U you need to understand thread locals

5:31:02and all those things and those things

5:31:03are already covered pretty well in the

5:31:05uh tell it one so that's the reason and

5:31:08you know like I was behind every one of

5:31:09you guys complete the Tet assignment

5:31:11because if you do that part you'll

5:31:13understand the entire ecosystem in a

5:31:14much more better way okay so please make

5:31:19sure you complete that one once it is

5:31:21done then probably I'll think of you

5:31:24know like taking the extent report and

5:31:26all or I'll upload it off directly on

5:31:28the uh like in your classroom recordings

5:31:31and all you'll find it over there ah

5:31:33whoever who was there um Akil the test

5:31:36started to execute right now see so

5:31:40that's something that has happened and

5:31:43um um make sure you practice this much

5:31:47generating report will not be the main

5:31:48thing but uh main issue as such but if

5:31:51you are

5:31:52comfortable um only with the tell it

5:31:55then watch it off else it's going to be

5:31:56a pure bouncer you'll be like just

5:31:58attending the class literally

5:32:00understanding nothing out of

5:32:02it I want to take it off buddy but the

5:32:06thing is key if I take it off then again

5:32:08people will say that it's going to go

5:32:09bouncer so okay so I don't want to do

5:32:13that part you already have the access to

5:32:15the LMS and the first thing that you

5:32:16should do is complete the tell it one

5:32:19I've been telling people to complete it

5:32:21part as soon as

5:32:24possible so that's the reason okay I

5:32:29have already implemented it off it's

5:32:31it's already kept over here at my end if

5:32:33you see somewhere uh like the SRC mean

5:32:37Java

5:32:38yeah the reporting is already created

5:32:40and kept over here now the only thing

5:32:43that comes into picture is if I start

5:32:45introducing all these things okay it's

5:32:48not something that it should go

5:32:50bouncer

5:32:53okay it's like and it's a onetime

5:32:56activity if you want I can give you the

5:32:58code right away you can take it in your

5:33:00chat box and keep it

5:33:03okay but the point

5:33:06is if if lecture needs to happen people

5:33:09need to understand that part else it's

5:33:11going to go little bit bouncer itself

5:33:13I'll do one thing this is the main

5:33:15project right I'll give it to

5:33:18you show

5:33:24in so J it's a covered in this extent

5:33:28manager me this report how to attach

5:33:32this header and authorization and

5:33:33response and all in the report yep okay

5:33:37go good

5:33:39because I know what happen generally

5:33:40happens right is see if you go to the

5:33:42report I'll show that

5:33:44part at least we can discuss about it

5:33:48the show

5:34:01in can you see the

5:34:04output yeah okay so how exactly the

5:34:08response needs to look what will be the

5:34:09response and all those things have kept

5:34:11it off over there when the test is

5:34:13passing and all those things are there

5:34:14this is something that generally you

5:34:16want to have it in the API API reports

5:34:18and all yes okay so you can take this

5:34:22particular framework okay I'll give you

5:34:25this part

5:34:25itself uh show in

5:34:50yeah

5:34:52done I put it in the download section or

5:34:55like attach in the chat guys people can

5:34:57download this one this is the entire

5:34:59framework for the rest is short it has

5:35:03the logger it has um everything the only

5:35:07the structure is a little bit different

5:35:08over there I was just practicing certain

5:35:10things

5:35:12so even if you want to practice at off

5:35:16just remember one thing I have kept

5:35:19these things in SRC main

5:35:22Java n the only difference is my test

5:35:26only the test is there in the p. API

5:35:29test okay SRC main Java has the other

5:35:32things I have the API filter also this

5:35:35is the same filter I created today for

5:35:36you okay and this is the only difference

5:35:40that's it

5:35:42okay nothing fancy as

5:35:48such all right we'll stop over here for

5:35:51today guys uh this I believe uh ends the

5:35:53group session for you guys okay I hope

5:35:55you have understood how exactly this

5:35:57particular stuff is created uh hope you

5:36:00like the session was it useful for you

5:36:02guys I don't know was it useful people

5:36:05who have seen this particular stuff

5:36:06whatever Affiliated so far yes yes yeah

5:36:08okay so I hope you will be able to

5:36:11answer all the interview related

5:36:13questions uh related to your API

5:36:16automation

5:36:21framework so the lecture will be

5:36:23available

5:36:24uh I think so by tomorrow itself and um

5:36:30the next thing over here guys is

5:36:32practice this particular stuff and the

5:36:35second thing that comes over here guys

5:36:36is whether

5:36:38um two assignments if you want to

5:36:41prepare for interviews tell it Carlo and

5:36:43the one which I've covered over here I

5:36:46mean like the better quality I wanted to

5:36:47Pro release it of in this year this

5:36:50month itself but it's not going to

5:36:52happen so I thought why when it's ready

5:36:54I'll just take it in the group session

5:36:56you will be able to answer most of the

5:37:00stuff

5:37:02okay okay that's something that's the

5:37:04reason I created that how to do masking

5:37:07masking uh because yeah it's required we

5:37:11have to mask that authorization part

5:37:14authorization part if you want to mask

5:37:16it off as in you want to hide it off in

5:37:18the reports that's what you're

5:37:21asking uh either hide from testing also

5:37:24our report also yeah masking how to do

5:37:27the mask give me a scenario over

5:37:31here give me me uh they don't want uh

5:37:34that uh username and password and all uh

5:37:37o token they don't want to uh they don't

5:37:41want to see it they don't want to see it

5:37:42in the report right if they don't want

5:37:44to see it in the report that's where you

5:37:46have your filters coming into

5:37:48picture Avid so when I'm setting the

5:37:51extend manager report if you see

5:37:53carefully I'm controlling it everything

5:37:55what exactly the things needs to be

5:37:57there so when you're getting a header

5:38:01right

5:38:09I will just put the values as Hash Hash

5:38:12Hash and then I'm going to continue it

5:38:13off so even if I want to make any

5:38:15changes I have to do it over here okay

5:38:18for the uh reports and as well as for

5:38:20the logs okay the same thing

5:38:24masking

5:38:28okay but I it will be covered I'll put

5:38:31it off in the LMS remember it

5:38:39okay but if I want I'll modify the

5:38:41script and give it to you yeah thank

5:38:44you uh any other questions

5:38:55okay yes guys any other

5:38:58questions so this wraps up your entire

5:39:01API Journey for the entire framework

5:39:04that we wanted to build three scenarios

5:39:06as I remember one is the jdbc

5:39:08connectivity which you want masking

5:39:11reporting I have already shown you any

5:39:12other any other requirement you guys can

5:39:14reach it off to me I'll plan it off like

5:39:17if I can put it in the stuff now before

5:39:20I end because I don't get time to you

5:39:22know usually connect I'm I'm changing

5:39:24few things here and there but I hope you

5:39:27know like I'm able to get that time so

5:39:32uh the thing is uh I have wrapped up as

5:39:35I said for the rest short like for the

5:39:37Java modules most possibly the team will

5:39:40release few important lectures for you

5:39:43guys uh this month

5:39:45itself so if you are starting let's

5:39:52say okay or you want to even prepare for

5:39:54the interviews also something like that

5:39:57just start with the concept of classes

5:39:59and objects okay and I I think it is one

5:40:04of the best stuff you'll find it

5:40:06anywhere because every design pattern

5:40:08because even if you have used the

5:40:09Builder design pattern in your rest ass

5:40:12short I have first showed you in your

5:40:14Java itself how it will be coming into

5:40:16picture Okay so till abstract classes I

5:40:21believe the team has released it off

5:40:23okay we have seen marking the particular

5:40:26class as abstract class your um you know

5:40:29like abstract method coming into picture

5:40:32so those things will be there uh couple

5:40:34of lectures which will be released this

5:40:36week is going to be of

5:40:39interfaces and exception handling okay

5:40:43these two things I have planned for this

5:40:46week okay the future lectures will be

5:40:49your generics Collections and mapping

5:40:53coming into PCT maps maps coming into

5:40:55picture the entire Java module is going

5:40:58to end on the Journey of logger as well

5:41:02as your Java database connectivity that

5:41:06time uh sujit I will be creating a

5:41:09scenario where I will read the data from

5:41:11the database and I will put it into a

5:41:13Java

5:41:23object

5:41:25yeah yeah any other

5:41:30questions so if you wish you I will

5:41:33suggest you guys to study it from you

5:41:35okay if you want to really make sure

5:41:37that your Java fundas and all those

5:41:38things are clear that's something that

5:41:40I've kept it over there yeah any

5:41:43anything else people want to add or say

5:41:45please

5:41:54ask Le or what like people I know it's

5:41:5712 but all good ride

5:42:01anjum shda snu joining after a long time

5:42:06okay yeah I'll revise you

5:42:10once

5:42:12okay not able to unmute I've given

5:42:14permission do

5:42:16one okay bat all

5:42:26good yeah okay cool

5:42:29guys

5:42:32okay all right guys so we'll probably

5:42:35stop for today now um

5:42:38tomorrow I believe uh we won't be

5:42:40connecting okay I will be ending this

5:42:43particular Journey over here with logs

5:42:45okay but uh the future Journey I'll put

5:42:48it on the LMS okay it will be there the

5:42:51event man extend report as well as as

5:42:54you said masking and all I'll try to

5:42:56create two three rough scenarios and

5:42:57give it to you if you guys have any

5:42:59requirement particularly for your

5:43:01framework for your stuff feel free to

5:43:03put it out over there because what

5:43:05happens is when you try to create a

5:43:07framework okay multiple

5:43:13scenarios database like you want to read

5:43:16data from the database and you want to

5:43:17pass it to the payload right um report

5:43:21generation when I started the class I

5:43:24said the various enhancement that you

5:43:26have done in your framework these are

5:43:27the things that you can easily remember

5:43:29just because it is not happening in your

5:43:31project doesn't mean that you should not

5:43:32be aware of it okay so

5:43:37okay this is something that is there and

5:43:39now I believe um if you have studied if

5:43:43you have studied uh so far with me the

5:43:46entire API automation framework and the

5:43:49conditional apply the tell it

5:43:52framework you are ready for the

5:43:54interviews I mean like just practice it

5:43:56one two more times or start by interview

5:43:59so when January happens you start giving

5:44:01the interviews whether it is going to be

5:44:04good bad ugly we'll we'll see it

5:44:06together okay we'll figure it out how to

5:44:08make it a little bit better over there

5:44:10all right so that's all from my end okay

Recently added transcripts

Browse the whole transcript library

This transcript was generated from the captions YouTube publishes for this video. Get the transcript of any YouTube video atfreeyoutubetranscribe.com, free, unlimited, no sign-up.