🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Automation Interview Questions: all 10 questions

Quiz: Automation Interview Questions · Question 9 of 10

How do you test an API that needs login?

How do you test an API that needs login?

  1. A.Hard-code an old token in every test
  2. B.Turn off security on the test server
  3. C.Log in inside the test, extract the token and send it as a Bearer header
  4. D.Only test public endpoints
Answer & explanation

Correct answer: Log in inside the test, extract the token and send it as a Bearer header

This keeps tests independent and always uses a fresh token.

Can you get the rest right without peeking?

Take the timed Quiz: Automation Interview Questions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →