在试图提交表单像这样安装watir-webdriver
:如何使用Watir获取js创建的令牌?
https://gist.github.com/f46e8a0ed433fdb16371587920ee4b64
想我可以做到这一点:
require 'watir-webdriver'
b = Watir::Browser.new
b.goto 'URL'
return b.execute_script(validateLoginForm())
不工作。
在试图提交表单像这样安装watir-webdriver
:如何使用Watir获取js创建的令牌?
https://gist.github.com/f46e8a0ed433fdb16371587920ee4b64
想我可以做到这一点:
require 'watir-webdriver'
b = Watir::Browser.new
b.goto 'URL'
return b.execute_script(validateLoginForm())
不工作。
这可能是一样简单:
return b.execute_script("return validateLoginForm()")
好吧,我跟着[这](https://mayxu.wordpress.com/2012/04/17/complete-mac-setup-guide-for-rubycucumberwatirselenium-12/)在Mac上安装,当我运行你的线火狐意外退出,当我终端中取消命令我得到[this](https://gist.github.com/anonymous/8bd673a1d532f620dd850478d359e632)。 – Forwarding
如何显示错误? – Forwarding
要收集JavaScript错误,您需要使用代理或访问正在测试的页面的源代码以添加自定义JavaScript。查看jimevans描述的一种方法使其工作:http://jimevansmusic.blogspot.com/2013/09/capturing-javascript-errors-in.html – titusfortner
然后获得存储在cookie或本地/会话存储的价值?你遇到了什么错误? – titusfortner