The following works fine in selenium-1:
sel = self.selenium
sel.get_eval("window.$('body form div ul li').html()")
When I try to the same in selenium-2 webdriver in python, I get a error.
wd = webdriver.Firefox()
wd.execute_script("window.$('body form div ul li').html()")
selenium.webdriver.common.exceptions.WebDriverException: window.$ is not a function
How can get that jquery to work in webdriver in python?
In selenium1 get_eval() evaluates a script and returns the result.
When you use execute_script() you have to explicitly return the value in which you are interested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With