Online Exam Quiz

questionQuestion  1 to 30

Which Cypress command is used to test the headers in the response?

  • cy.should('include')
  • cy.headers()
  • cy.request().its('headers')
  • cy.check()
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 send data along with a POST request in Cypress?

  • cy.postData()
  • cy.request({ method: 'POST', body: {...} })
  • cy.post()
  • cy.sendData()
Mark for review

Which of these methods is used to stub a response in Cypress?

  • cy.stub()
  • cy.route()
  • cy.intercept()
  • cy.mock()
Mark for review

How can you ensure that an API returns an empty array in Cypress?

  • .should('be.empty')
  • .should('contain.empty')
  • .should('not.have')
  • .should('have.empty')
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

Which command is used to intercept API requests in Cypress?

  • cy.intercept()
  • cy.listen()
  • cy.stub()
  • cy.request()
Mark for review

What is the default timeout for Cypress API requests?

  • 10000 ms
  • 5000 ms
  • 15000 ms
  • 2000 ms
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

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

In Cypress, how can you check if an API returns a specific field?

  • .should('have.property')
  • .should('contain')
  • .should('have')
  • .should('field')
Mark for review

How do you handle API timeouts in Cypress?

  • cy.request() with timeout option
  • cy.wait() with timeout option
  • cy.pause() with timeout option
  • Use cy.setTimeout()
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 do you pass parameters in a URL for Cypress API requests?

  • Use cy.request({ url: 'api/{id}', params: {...} })
  • Use cy.request({ url: 'api?id={id}' })
  • Use cy.query()
  • Use cy.get()
Mark for review

What is the default method for cy.request() in Cypress?

  • POST
  • GET
  • PUT
  • DELETE
Mark for review

How do you simulate an error in an API response using Cypress?

  • Use cy.route() with error response
  • Use cy.stub() with error response
  • Use cy.request() with error status code
  • All of the above
Mark for review

Which Cypress command is used for simulating HTTP requests?

  • cy.stub()
  • cy.route()
  • cy.request()
  • cy.query()
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 do you simulate a successful 200 status code response in Cypress?

  • cy.route({ status: 200 })
  • cy.stub({ status: 200 })
  • cy.request() with status 200
  • Use cy.response()
Mark for review

Which method in Cypress is used to send POST requests?

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

How do you handle a 401 unauthorized API request in Cypress?

  • Use cy.authenticate()
  • Use cy.request() with authorization header
  • Use cy.request() with cookies
  • Use cy.auth()
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

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 is the role of cy.intercept() in Cypress API testing?

  • It waits for the request to finish
  • It mimics requests and responses
  • It verifies the API response status
  • It simulates browser events
Mark for review

How can you validate if an API response body matches a fixture file in Cypress?

  • cy.match()
  • cy.fixture().should('equal')
  • cy.request().its('body').should('deep.equal')
  • cy.compare()
Mark for review

Which method helps you check if an API response contains a specific string?

  • .should('contain')
  • .should('equal')
  • .should('be.equal')
  • .should('include')
Mark for review

How do you assert that an API response is an array in Cypress?

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

How do you perform an assertion on the response time of an API call in Cypress?

  • .should('be.lessThan')
  • .should('be.gt')
  • .should('have.duration')
  • .should('have.responseTime')
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

What should you use to intercept an API request made by a page before it completes in Cypress?

  • cy.route()
  • cy.stub()
  • cy.get()
  • cy.intercept()
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