Is there a way in TestCafe to validate Chrome network calls?

ぐ巨炮叔叔 提交于 2019-12-10 10:28:08

问题


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.

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?

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


回答1:


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.



来源:https://stackoverflow.com/questions/55642888/is-there-a-way-in-testcafe-to-validate-chrome-network-calls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!