I am using robot frame work, I have to get some grid content using jquery. I have used "Execute Javascript" command. But it is not recognizing any jquery commands like document. or window. I am using selenium 2. I have googled for last two days found no relevant answers. Please tell me if we have to give any new libraries or download selenium1 library instead of selenium2.

ERROR: javascript | FAIL | WebDriverException: Message: u"unknown error: Object [object global] has no method 'getElementById'\n (Session info: chrome=32.0.1700.107)\n (Driver info: chromedriver=2.8.241075,platform=Windows NT 6.1 SP1 x86_64)"

有帮助吗?

解决方案 2

Instead of getElementById try using $('#elementid')

其他提示

http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html#Execute%20Javascript

Note that, by default, the code will be executed in the context of the Selenium object itself, so this will refer to the Selenium object. Use window to refer to the window of your application, e.g. window.document.getElementById('foo').

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top