Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在测试一个 zk 表单,我想点击一个按钮。我的zk代码如下:
<zk:button id="btnLogin" label="Entrar" onClick="wndLogin.onLogin()" style="font-weight: bold; font-size:12px;" />
我的watir代码如下所示:
browser.button.click
我在页面上只有一个按钮。当我运行脚本时,我收到一个错误,指出页面上不存在按钮。
我相信问题是由命名空间引起的 - 即'zk'。通过使用 css 选择器,我只成功地使用了命名空间中的元素或属性:
browser.element(:css => 'zk\:button').click
请注意,冒号需要转义。