javascript - 如何修复 NetworkError:无法在“XMLHttpRequest”上执行“发送”:无法加载
问题描述
- 包括有关您的目标的详细信息
我想访问网站并单击一个元素,这是第一次测试,然后第二次测试将再次访问同一网站并单击一个元素。两个测试合而为一描述
描述预期和实际结果打开网站并点击元素,然后在第二次测试中打开相同的网站并点击元素
包括任何错误消息
NetworkError:无法在“XMLHttpRequest”上执行“发送”:无法加载“ https://gcpsmapi.example.com/sec/submit-events ”:页面关闭中的同步 XHR。
我试图在没有运气或解决方案的情况下搜索谷歌。我使用 beforeEach 并且我单独尝试了每个测试并且它有效。但在一起是行不通的。
describe('Checkout', () => {
it('Checkout with empty cart', () => {
cy.visit('https://www.example.com')
cy.get('.lgi_btn_3').click()
cy.get('.xo-header__cart > .xo-header__navigation-button > .xo-core-header-icon').click()
cy.url().should('include', 'https://www.example.com/shop/winkelwagen/index.shtml')
cy.contains('empty').should('be.visible')
})
it('2nd', () => {
cy.visit('https://www.example.com')
cy.get('.lgi_btn_3').click()
cy.get('.xo-header__cart > .xo-header__navigation-button > .xo-core-header-icon').click()
cy.url().should('include', 'https://www.example.com/shop/winkelwagen/index.shtml')
cy.contains('empty').should('be.visible')
})
})
解决方案
推荐阅读
- javascript - html range elemnt - 在点击事件上移动
- java - 创建通用 JavaBean 构建器
- c - 转移到预处理器以避免间接
- django - django leaflet_map 如何按需添加geojson层
- elasticsearch-6 - elasticsearch 6.2 如何在一个映射中指定子字段和父字段(_doc)
- android - textview在换行后删除空格
- angularjs - 如何避免在嵌套范围内使用`$parent.$parent.$parent`
- html - HTML 电子邮件签名 Gmail 应用程序在每个表格之间添加了额外的空间
- ruby-on-rails - 我可以在 paper_trail 中存储自定义版本的 object_changes 吗?
- python-3.x - 使用python打开.mat(matlab数据)