jonfriesen
jonfriesen

Reputation: 615

Ajax Control Toolkit ComboBox javascript update/change

I'm trying to write an automated UI test. I am utilizing a ComboBox from the Ajax Controlkit for asp.net.

My testing framework injects the value of the combobox option I'm selecting but when it does the postback the default value is posted not the new one (even though the new value was displayed before the postback occured).

I found that if I inject the new value, then simply give the combobox a physical click and continue the test the postback posts the correct value.

I assume that the physical click calls a javascript function to update the field, but I just can't seem to figure out what function I should be calling in my test.

I appreciate any suggestions!

Cheers Jon

Upvotes: 3

Views: 2157

Answers (1)

IUnknown
IUnknown

Reputation: 22458

var extender = $find("ctl00_SampleContent_ComboBox1");
extender.get_textBoxControl().value = "Bravo";
extender._onTextBoxBlur();

Works well on this page: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx

Upvotes: 2

Related Questions