I have a div in an html page like the following:
<div id="save_one" onclick="save_one()" >Save Contact Info</div>
save_one() gets all the form data in a form below and saves using an ajax call.
Clicking the div ought to save the contents, and it does using a mouse, but I've been unable to get it to work with Selenium.
The page has an
<img onclick='edit_table()'>
that when clicked opens the table to be edited as a form. I'm able to do that with selenium. I'm also able to update the form with new data using Selenium.
When attempting to submit it using the div shown above it fails unless I extract the script from the .js file and run it with Selenium using:
$sel->get_eval( $js_save_one ); # $js_save_one is the js sub in a string in the perl
# test file
Is it the case that selenium only handles certain Javascript functionality? If that is not the case, anyone know why this would not operate as it does using the mouse?
Using the Selenium firefox extension, it can create the code for whatever language you are using to run selenium through and it will tell you how to do this. Basically though there is a function for clicking a button/image.