每当我尝试在 Selenium 中播放测试用例时,我总是会遇到此错误
[error] Permission denied for <http://www.facebook.com> to get property Location.href
最佳答案
听起来您遇到了 javascript 的同域安全策略。
参见此处:http://www.codingforums.com/showthread.php?t=117050 .
如果没有关于您的测试用例的更多信息,很难具体说明,但基本问题可能是
JavaScript has a same domain policy for security reasons. That means it can not touch other domains.
在链接资源的示例中,用户能够替换
top.document.location.href = searchLocation;
与
window.open(searchLocation, "_top");
解决问题。
关于selenium - Selenium Testcase 播放错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8236026/