Cypress Tutorial
Selected Reading
- Cypress - Discussion
- Cypress - Useful Resources
- Cypress - Quick Guide
- Cypress - GitHub
- Cypress - Plugins
- Cypress - Reports
- Cypress - Configuration of JSON File
- Cypress - Hooks
- Cypress - Environment Variables
- Cypress - Fixtures
- Cypress - Custom Commands
- Cypress - Debugging
- Cypress - Screenshots and Videos
- Cypress - Dashboards
- Cypress - Prompt Pop-up Window
- Cypress - Data Driven Testing
- Cypress - File Upload
- Cypress - Get and Post
- Cypress - Cookies
- Cypress - Mouse Actions
- Cypress - Web Tables
- Cypress - Frames
- Cypress - Hidden Elements
- Cypress - Child Windows
- Cypress - Alerts
- Cypress - Dropdown
- Cypress - Tabs
- Cypress - Checkbox
- Cypress - jQuery
- Cypress - Working with XHR
- Cypress - Asynchronous Behavior
- Cypress - Text Verification
- Cypress - Assertions
- Cypress - Locators
- Cypress - Aliases
- Cypress - Variables
- Cypress - Basic Commands
- Cypress - Supported Browsers
- Cypress - Build First Test
- Cypress - Test Runner
- Cypress - Architecture and Environment Setup
- Cypress - Introduction
- Cypress - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Cypress - Working with XHR
Cypress - Working with XHR
XHR is XML HTTP Request. 它是“应用方案拟订接口”,作为目标提供,其方法在网络浏览器和服务器之间传送数据。 XHR的物体可要求服务器以答复形式提供数据。
气压不仅可用于前端自动化,而且可以通过直接接触XHR物体来控制网络的交通。 然后,它适用对物体的断言。 它可以改变或阻碍反应。 在浏览器上填写的网络中可以看到XHR的细节。
XHR的回应负责人如下:
![XHR Response Header](/cypress/images/xhr_response_header.jpg)
答复如下:
![Response](/cypress/images/response.jpg)
为了提出XHR的要求,使用了cy(request)指挥系统。 采用的方法是将答复转向对等要求。
Implementation of XHR request
下面是关于在Cypress执行XHR请求的指挥部。
cy.request( https://jsonplaceholder.cypress.io/comments ).as( c ) //apasing request cy.get( @c ).should((response) => { expect(response.body).to.have.length(100) expect(response).to.have.property( headers ) })Advertisements