Online Exam Quiz

questionQuestion  1 to 30

How do you handle authorization for API requests in Cypress?

  • Use cy.login()
  • Use cy.auth()
  • Use cy.request() with headers
  • Use cy.request() with cookies
Mark for review

How do you verify the status text in the response in Cypress?

  • .should('have.statusText')
  • .should('have.text')
  • .should('equal.statusText')
  • .should('contain.statusText')
Mark for review

What is the primary use of the .as() function in Cypress API testing?

  • To alias the request
  • To alias the response
  • To alias the variable
  • To alias the timeout
Mark for review

How do you test the POST request body in Cypress?

  • .should('equal')
  • .should('include')
  • .should('contain')
  • .should('have.deep.property')
Mark for review

How do you ensure the response body is not null in Cypress?

  • .should('not.be.null')
  • .should('exist')
  • .should('not.have.property', 'null')
  • .should('not.equal', null)
Mark for review

What method is used to handle a failed request in Cypress?

  • .should('fail')
  • .catch()
  • .then()
  • .should('be.false')
Mark for review

How can you verify an API response is JSON and contains a specific field?

  • .should('be.json') and .should('have.property')
  • .should('contain.json') and .should('include.property')
  • .should('equal.json') and .should('be.deep')
  • .should('match.json') and .should('include')
Mark for review

What is used to handle delays in API requests in Cypress?

  • cy.wait()
  • cy.delay()
  • cy.pause()
  • cy.waitFor()
Mark for review

How can you send a PUT request in Cypress?

  • cy.putRequest()
  • cy.send()
  • cy.updateRequest()
  • cy.request()
Mark for review

What is the purpose of cy.wait() in Cypress API testing?

  • To pause execution
  • To handle multiple requests
  • To wait for API responses
  • To simulate delays in requests
Mark for review

How can you verify that an API response body is a string in Cypress?

  • .should('be.string')
  • .should('be.a', 'string')
  • .should('have.type', 'string')
  • .should('be.equal', 'string')
Mark for review

How do you test the status code of an API response in Cypress?

  • .should('have.status')
  • .should('equal')
  • .should('be.equal')
  • .should('have.code')
Mark for review

How do you set the response status code in Cypress?

  • .statusCode()
  • .setStatus()
  • .setResponse()
  • .status()
Mark for review

How do you assert that an API response contains a header with a specific value in Cypress?

  • .should('have.property', 'headers')
  • .should('have.header', 'Content-Type')
  • .should('include.header', 'Content-Type')
  • .should('contain.header', 'Content-Type')
Mark for review

In Cypress, how do you skip API request assertions temporarily?

  • Use cy.skip()
  • Use cy.ignore()
  • Use cy.pause()
  • Use cy.wait()
Mark for review

How do you handle API requests with Cypress when dealing with dynamic URLs?

  • Use cy.intercept()
  • Use cy.request() with dynamic data
  • Use cy.route()
  • Use cy.query()
Mark for review

What Cypress command allows you to change request body data dynamically?

  • cy.body()
  • cy.sendData()
  • cy.fixture()
  • cy.request()
Mark for review

What happens if an API request takes longer than the specified timeout in Cypress?

  • It retries the request
  • It throws an error
  • It cancels the test
  • It waits indefinitely
Mark for review

How do you send data with a GET request in Cypress?

  • cy.request({ method: 'GET', body: {...} })
  • cy.request({ method: 'GET', query: {...} })
  • cy.get()
  • GET requests do not send body data
Mark for review

Which of the following assertions checks the response status code?

  • .should('equal')
  • .should('include')
  • .should('be.gt')
  • .should('have.status')
Mark for review

In Cypress, what is the correct way to handle a failed API request?

  • cy.should('fail')
  • cy.on('fail')
  • cy.request().fail()
  • cy.catch()
Mark for review

Which method in Cypress is used to send POST requests?

  • cy.postRequest()
  • cy.send()
  • cy.request()
  • cy.submit()
Mark for review

What is the purpose of cy.request().then() in Cypress API testing?

  • To wait for the response
  • To assert the response body
  • To chain multiple actions after the request
  • To handle request failures
Mark for review

How do you test the response time of an API in Cypress?

  • .should('have.responseTime')
  • .should('be.lt', 200)
  • .should('have.property', 'responseTime')
  • .should('be.gt', 1000)
Mark for review

How can you make an API request wait for another API request to finish in Cypress?

  • cy.wait()
  • cy.get()
  • cy.chain()
  • cy.then()
Mark for review

How do you test if an API response contains a certain key?

  • .should('contain.keys')
  • .should('have.property')
  • .should('include.key')
  • .should('have.deep.property')
Mark for review

What is the default timeout for Cypress API requests?

  • 10000 ms
  • 5000 ms
  • 15000 ms
  • 2000 ms
Mark for review

How can you perform an API request with a query parameter in Cypress?

  • cy.request({ method: 'GET', params: { id: '123' } })
  • cy.query({ method: 'GET', params: { id: '123' } })
  • cy.get()
  • cy.request({ method: 'GET', query: { id: '123' } })
Mark for review

How can you verify the API response body is an array in Cypress?

  • .should('be.array')
  • .should('have.length')
  • .should('be.json')
  • .should('contain', 'array')
Mark for review

How do you test the status code for a failed request in Cypress?

  • .should('be.gt', 400)
  • .should('have.status', 404)
  • .should('equal', 404)
  • .should('match', 404)
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review