문제

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