18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Can't click imagesubmit button
How does sahi recognise the imagesubmitbuttons?
I have two submit buttons on one form and sahi can't click on a single imagesubmitbutton, and sahi wont click on either of the submit buttons.
_click(_imageSubmitButton(" Place Order on Hold "));
_click(_imageSubmitButton(" Cancel this order and update the status history "));
I tried this but this doesn't work either..
_click(top.document.images[13]);
Any ideas? Cheers for the help!
I have two submit buttons on one form and sahi can't click on a single imagesubmitbutton, and sahi wont click on either of the submit buttons.
_click(_imageSubmitButton(" Place Order on Hold "));
_click(_imageSubmitButton(" Cancel this order and update the status history "));
I tried this but this doesn't work either..
_click(top.document.images[13]);
Any ideas? Cheers for the help!
Comments
When running the sahi scripts, sahi clicks on the imagesubmitbuttons, but nothing happens and it errors on the next line.
Here is the code for the buttons...
<a href="**site**.php?action=cancel"><img src="images/gd/button_gen.php?text=Cancel" border="0" alt="Cancel" title=" Cancel "></a><input type="image" src="images/gd/button_gen.php?text=Next" border="0" alt="Next" title=" Next " name="sm" value="submit">
Does sahi handle imagesubmitbuttons differently when dealing with values on a form?
Hope this helps, Narayan, thank you very much for help with this issue.
Thanks again!
For IE6: the browser refreshes the page, but the submit button is not clicked, with no errors
For Firefox: I get these errors...
<code>
_click(_imageSubmitButton(" Cancel this order and update the status history ")); TypeError: el has no properties
https://dev.avowsystems.com/_s_/spr/concat.js:307
https://dev.avowsystems.com/_s_/spr/concat.js:311
https://dev.avowsystems.com/_s_/dyn/Player_script/script.js:2
https://dev.avowsystems.com/_s_/dyn/Player_script/script.js:2
https://dev.avowsystems.com/_s_/spr/concat.js:2210
https://dev.avowsystems.com/_s_/spr/concat.js:2124
</code>
Not sure what the issue is, but would really like some help resolving this issue. Thanks!
I'm developing a testing system for our company and sahi is perfect for the job. Really appreciate the effort you've put in as I've been able to customize sahi to fit our testing needs. Thanks again!
Here is the $_POST statement for when I click with the mouse, on an imagesubmitbutton
Array ( [comments] => [private_comments] => [notify_comments] => 1 [cancel_x] => 60 [cancel_y] => 10 )
Here is the $_POST returned when sahi is running and clicks on _click(_imageSubmitButton("cancelbutton"));
Array ( [comments] => [private_comments] => [notify_comments] => 1 [cancel_x] => 0 [cancel_y] => 0 )
The submit button does not recognize programmatic clicking, hence the co-ords are (0,0) instead of with a mouse click (60,10). We POST the co-ord of the button to get around an IE6 bug.
The only api I have found that clicks on a given set of co-ordinates is _dragDropXY ?? Is there another for a static single click?
Also, how should I incorporate that into the _click(_imageSubmitButton( statement?
Cheers, Narayan!
For IE, Sahi calls element.click(); It is a JS method exposed by the browser itself. Not sure why it does not have the coords.
Here is an explicit way to invoke a click with x, y coords.
where x and y are numbers.
The full signature of that function is: Note that this method will give only the click event. Not mouseup/mousedown etc.
Let me know what you find.
Does't fix the issue of sahi not recognizing the click, but its a work-around that is running nightly on our system and works great.