我有一个测试用例,我需要导航到网页并在 chrome 浏览器中验证该页面的网络调用.理想情况下,我会将它们放入一个变量中,并为某些与分析相关的调用过滤它们并验证它们的值.
I have a test case where I need to navigate to a webPage and validate the network calls in chrome browser for that page. Ideally, I would take them in a variable and filter them for certain analytics related calls and validate their values.
这可以通过 Selenium 中的 chrome 功能来完成.请参阅此处的文档:http://chromedriver.chromium.org/logging/performance-log 但我想通过 testCafe 来做到这一点?
This can be done through chrome capabilities in Selenium. See doc here: http://chromedriver.chromium.org/logging/performance-log but I am trying to do this through testCafe?
我遇到了这个文档:https://testCafe 网站上的 devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/ 但我不确定这是否与在 chrome 中获取性能日志相同.基本上,如果我能够在 chrome 中的开发人员工具下的网络选项卡中获取所有调用,我应该能够使用 JavaScript 对其进行过滤并完成我的测试.
I came across this documentation: https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/ on testCafe site but I am not sure if this is same as getting hold of performance logs in chrome. Basically, if I am able to grab hold of all the calls in the network tab under developer tools in chrome, I should be able to filter it using JavaScript and complete my testing.
与此相关的任何输入都会有所帮助.谢谢
Any inputs related to this would be helpful. Thanks
是的,都是一样的:RequestLogger对象存储测试运行期间发送的所有 HTTP 请求和接收的响应.这与在当前测试运行期间抓住您的网络活动(网络"标签)相同.您还可以使用 filter 和 options 参数调整您的 Logger.
Yes, it is the same: the RequestLogger object stores all HTTP requests sent and responses received while the test is running. It's the same as grabbing hold of your network activity (the "Network" tab) during the current test run. You can also tune your Logger using both filter and options parameters.
这篇关于TestCafe 有没有办法验证 Chrome 网络调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Angular 2/Typescript 中使用 IScrollUse IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
Anime.js 在 Ionic 3 项目中不起作用anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 项目中不起作用)
Ionic 3 - 使用异步数据更新 ObservableIonic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用异步数据更新 Observable)
Angular 2:在本地 .json 文件中找不到文件Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指令?)
将 ViewChild 用于动态元素 - Angular 2 &离子2Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(将 ViewChild 用于动态元素 - Angular 2 amp;离子2)