Differences
  • Placement 360 CourseExplore
  • Software Testing Day 49

    Last Updated :
    Discuss
    Comments

    Question 1

    You send a POST request in Postman with raw JSON body, but the server responds with 415 Unsupported Media Type. What is the most likely fix?

    • A

      Change request type from POST to PUT

    • B

      Add "Content-Type": "application/json" header

    • C

      Encode the body in Base64

    • D

      Move the body into query parameters

    Question 2

    In REST Assured, what happens if you don’t set Content-Type when sending a JSON body?

    • A

      REST Assured automatically sets it to JSON

    • B

      The server always rejects it

    • C

      It depends on the server; it may interpret it incorrectly

    • D

      REST Assured converts JSON to XML

    Question 3

    You run a GET request in Postman and get 200 OK but the response body is empty. Which of the following is the BEST debugging step?

    • A

      Switch to POST instead of GET

    • B

      Add authorization headers or tokens

    • C

      Increase timeout in Postman

    • D

      Retry with Content-Type set to JSON

    Question 4

    In REST Assured, what will happen if your statusCode(201) assertion is applied but the API actually returns 200?

    • Test passes silently

    • Test fails with Assertion Error

    • Test retries until it gets 201

    • REST Assured converts 200 into 201 internally

    Question 5

    You update a resource using PUT in REST Assured, but the server overwrites fields you didn’t send. Which HTTP method would prevent this issue?

    • A

      GET

    • B

      DELETE

    • C

      PATCH

    • D

      HEAD

    Question 6

    While testing DELETE with Postman, you receive 204 No Content. What does this mean?

    • A

      The resource was deleted successfully and server has nothing more to return

    • B

      The resource is not found

    • C

      The resource was not deleted but no error occurred

    • D

      The resource is locked by another request

    Question 7

    A developer claims the API is idempotent. Which of the following POST/PUT/DELETE behaviors violates idempotency?

    • A

      Sending DELETE twice removes the resource the first time, second time returns 404

    • B

      Sending PUT twice with same body updates the resource only once

    • C

      Sending POST twice creates two new resources

    • D

      Sending GET multiple times always returns same resource

    Question 8

    In REST Assured, you use .extract().response(). Why would you store the response object?

    • A

      To assert only the status code

    • B

      To save the request for replay

    • C

      To validate fields in JSON body or headers

    • D

      To bypass serialization

    Question 9

    You send a POST in Postman with JSON but receive a 400 Bad Request. Which of these is MOST LIKELY the cause?

    • A

      No internet connection

    • B

      Incorrect JSON formatting (extra commas, missing quotes)

    • C

      The server is down

    • D

      Wrong HTTP version

    Question 10

    In REST Assured, you chain .then().statusCode(200).body("id", equalTo(1)). What is happening here?

    • A

      Only status code is checked

    • B

      REST Assured checks both status code and a JSON field in the response

    • C

      It extracts the response body for reuse

    • D

      It retries until both conditions pass

    There are 10 questions to complete.

    Take a part in the ongoing discussion