1

I want to run automated tests that will execute a Javascript file. The JS calls a number of URLs through AJAX calls and image loads, each of which leads to the site being called dropping a cookie.

Since I cannot read those cookies with Javascript, I don't know whether I can actually test this script.

What is the best way of approaching this problem? Browser extensions?

4

1 回答 1

0

最简单的方法可能是用您自己的本地模拟站点替换 AJAX URL,这些站点除了验证 cookie(或触发消息)是否正确发送之外什么都不做。

于 2012-10-12T12:22:26.980 回答