Selenium onChange not working
I have tried a number of things to try and get Selenium to pick up an ‘onchange’ event from a drop down menu, none of which has worked.
The offending HTML is:
<select onchange="doOpperation(this.options[this.selectedIndex]); this.selectedIndex = 0;" name="opps_ondemand" id="opps_ondemand">
<option value="none" id="ondemand">Mark as...</option>
<option cmd="blah1" value="add">Something</option>
<option cmd="blah2" value="remove">None</option>
I have read that Selenium IDE doesn’t record some on* events, and so it would be wise to use fireEvent():
$this->select("opps_ondemand", "label=Mark as...");
However, this does not work (with or without the fireEvent). I have also tried using
but this did nothing.
Selenium does not complain about these locators not existing so I am assuming it can see the select/option elements fine. The problem seems to be the onChange event.
Does anyone know how to resolve this?
- You must login to post comments