下面是我的代码。当我运行它时,它显示 WebDriverException。如何在 Robot Framework 中执行 JavaScript 代码?
This, return $(arguments[0]).data('${ToolTip}').options.title
代码在 -java Selenium Web 驱动程序中运行良好。
Mouse Over ${CreateTask}
Execute JavaScript return $(arguments[0]).data('${ToolTip}').options.title
From http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Execute%20Javascript:
请注意,默认情况下,代码将在
Selenium 对象本身,因此 this 将引用 Selenium 对象。使用
window 指您的应用程序的窗口,例如
window.document.getElementById('foo').
So
Mouse Over ${CreateTask}
Execute JavaScript return window.$(arguments[0]).data('${ToolTip}').options.title
假设有一些库(最有可能是 jQuery)实际上理解$
速记。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)