I am trying to create and execute a JavaScript function with Selenium. I am doing it like this:
js_func = """
function blah(a, b, c) {
.
.
.
};
"""
self.selenium.execute_script(js_script)
self.selenium.execute_script("blah", 1,2,3)
I don't get any errors from the first one (creating the function), but the second one gives me:
WebDriverException: Message: u'blah is not defined'
Is what I'm doing valid? How I can tell if the function was successfully created? How can I see the errors (assuming there are errors)?