← 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?
- A.Hard-code an old token in every test
- B.Turn off security on the test server
- C.Log in inside the test, extract the token and send it as a Bearer header
- 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 →