API Testing · Middle · Question 47 of 75
How should API tests handle environment-specific values?
- 1Config or env variables for base URLs, keys and accounts
- 2Use production values everywhere to keep things simple
- 3Hard-code staging values and edit them for each run
Show the answer
Correct answer: Config or env variables for base URLs, keys and accounts
Explanation
The same suite then runs on local, staging and preview environments, with secrets kept out of the code.