Login API Test through rest api


#1

How to test Login API. Plz provide me some sample also.


Automation API test for Login API using Rest Assured
#2

Hi,

please be more specific. What is “login API” and what you want to test?


#3

Hi,

I want to test Login api or for regsitration API of any app. Please provide any sample for post request API test in rest API.
If you have any sample then please provide me. I have googled and not found enough sample on the Login/Registration API


#4

Still not getting it. Do you want to get auth token from auth service or what?


#5

I want to test API for Login services. I have found the youtube sample but its not match my requirement.

Please suggest some more sample by which I can create Automation API test on login/registration API.
is it clear now?


#6

Can you share what your request should look like? Headers, body etc.,


#7

I am new in Automation API and found few more sample guide to understand how to Automate API for Login/registration basically for put request API in katalon


#8

Ok, let me explain you how things happen in REST API.

Login is UI action and consists of few steps.

  1. You have some login page, where you put your credentials and click log in.
  2. Your credentials are sent to auth service
  3. Auth service decides, if you are allowed to enter the protected area or not
  4. If so, it sends back auth token
  5. This token is used for all API calls inside of your protected area.

So, now please tell me, which step you want to automate.


#9
  1. Status code will show correct
  2. Registered fields have been enter correctly and if passed then OTP generated then verify OTP
  3. Then verify Register successfully or not
  4. After registration enter login field correctly
  5. OTP verifed
  6. Then Login Successfully
    For registration and Login there will be two different API

#10

Did you read this article?

You may need to parse first response to get your OTP.and use it in second request.


#11

This is totally manual approach. How can I use these codes using object repository and test case.Please guide on that based.


#12

Hi, Can you please help me?


#13

Do you want the code to be automatically generated?
I don’t think that’s possible.
you have to write your API tests manually, that’s what I do to test mine


#14

okay if I do using manually then please suggest me how can I do the same?


#15

1-referencing the services to be called in object repository (variabilize if necessary)
2- Write the test cases in Tests case

all documentation is available: https://docs.katalon.com/katalon-studio/tutorials/introduction_api_testing.html