b.send_keys :tab
上面那行在我的 Mac 上不适用于 safari。我正在运行 watir-webdriver 0.6.1 和 selenium-webdriver 2.22.2。
我收到以下错误:
Failure/Error: b.send_keys :tab
Selenium::WebDriver::Error::UnknownError:
Maximum call stack size exceeded.
我还没有安装 safari 驱动程序。直接借助上述 2 个 gem 即可运行。
最佳答案
Safari 支持最近才添加到 webdriver,据我所知,如果没有 safari-driver(它采用您需要编译的 safari 浏览器扩展的形式),您将无法驱动 safari。
引用自 Selenium 网站:
While ready for use, the SafariDriver still requires a bit of manual intervention before you can start writing tests. If you're not comfortable checking out and building the Selenium project from source, you may want to wait for us to make a general SafariDriver release.
我会按照说明开始 here
如果您对此不满意,我会针对 Firefox 或 Chrome(无论如何代表更大的用户群)进行测试
关于testing - watir-webdriver(send_keys)功能中的 Safari 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11042390/