nerdexam
iSQI

CTAL-TAE · Question #65

An automated test script makes a well-formed request to a REST API in the backend of a web app to add a single item for a product (with ID=710) to the cart and expects a response confirming that the…

The correct answer is D. WARN. The situation indicates an issue with test data (product out of stock), not a failure of the system or the test itself. This is best logged as a warning (WARN) so it draws attention without being treated as a fatal or system error, while still highlighting that the test outcome…

Reporting and Metrics

Question

An automated test script makes a well-formed request to a REST API in the backend of a web app to add a single item for a product (with ID=710) to the cart and expects a response confirming that the product is successfully added. The status line of the API response is ‘HTTP/1.1 200 OK’, while the response body indicates that the product is out of stock. The API response is correct, the test script fails but completes, and the message to log is: ‘The product with ID=710 is out of stock. Cart not updated’. When this occurs, you are already aware that both the failed test and the API are behaving correctly and that the problem is in the test data. The TAS supports the following test logging levels: FATAL, ERROR, WARN, INFO, DEBUG. Which of the following is the MOST appropriate test logging level to use to log the specified message?

Options

  • AFATAL
  • BINFO
  • CDEBUG
  • DWARN

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    8% (2)
  • C
    12% (3)
  • D
    76% (19)

Explanation

The situation indicates an issue with test data (product out of stock), not a failure of the system or the test itself. This is best logged as a warning (WARN) so it draws attention without being treated as a fatal or system error, while still highlighting that the test outcome is affected by data

Topics

#log levels#WARN level#REST API testing#test logging

Community Discussion

No community discussion yet for this question.

Full CTAL-TAE Practice