Kari Newman
Kari Newman

Reputation: 11

Cannot click Submit button on Selenium IDE

I am having trouble getting Selenium IDE to click the Submit button on one of my webforms after having selenium open and fill out the form. I am using the clickAndWait command and identifying the button by its ID:

 <td>clickAndWait</td>
 <td>id=ctl00_ContentPlaceHolder1_OSVFHResults_btSave</td>
 <td></td>

Interestingly, if I write a script that simply opens the form and clicks the submit button without filling it out, I am not having any problems. My problem is coming specifically after I've asked Selenium to fill out the form. Additionally, if I try to manually click the submit button, it doesn't work if the Selenium script to fill out the form was run before my manual input. If I manually open and fill out the form, I have no problems clicking submit, and Selenium works for all of the other form's submit buttons on the site. Anyone have any ideas?

Upvotes: 1

Views: 5103

Answers (3)

Manigandan
Manigandan

Reputation: 5080

After type the values in the form just try "ClickAtandWait" instead of "clickandWait"..i also face the problem once and it gave hands once..

selenium.clickAtandWait("locator", "position");

if you know the exact "position" just put it, otherwise leave it as an empty string.

Upvotes: 1

Aleh Douhi
Aleh Douhi

Reputation: 1988

Instead of filling form with type command you can try typeKeys one. It simulates keystroke events on the specified element, as though you typed the value key-by-key and probably enable your submit button.

Upvotes: 2

shamp00
shamp00

Reputation: 11326

It sounds like some javascript event unrelated to click() (such as mouseover or onkeydown) is attached to one or more of the form fields and is responsible for enabling the submit button.

You'd have to look at which exact events are being fired, either by looking at the source with something like firebug, or by using a javascript debugger. Then modify your Selenium script to make sure the same events get triggered.

Upvotes: 1

Related Questions