简体   繁体   English

如何在Selenium IDE中运行嵌入在页面中的脚本?

[英]How to run a script embedded in the page in Selenium IDE?

I'm testing a page with Selenium IDE and want to execute a method already in the page. 我正在使用Selenium IDE测试页面,并且想要执行页面中已经存在的方法。 I've tried getEval(window.name.space.function()) but it just returns window.name is undefined. 我已经尝试过getEval(window.name.space.function())但它只是返回window.name是未定义的。 Is this possible? 这可能吗?

There is a getCurrentWindow() function which for unfathomable reasons only allows you to access "safe" properties (what is this supposed to protect against? people maliciously doing drive-by testing of other people's website?). 有一个getCurrentWindow()函数,出于不可思议的原因,它仅允许您访问“安全”属性(这应该防止什么?有人恶意地对他人的网站进行路过测试?)。 Newer versions offer a getUserWindow() function that solves those issues. 较新的版本提供了解决这些问题的getUserWindow()函数。 See this blog entry and this issue for details. 有关详细信息,请参见此博客条目本期

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM