我正在尝试编写自动UI测试。 我正在使用Ajax Controlkit中的一个ComboBox for asp.net。
我的测试框架注入了我正在选择的组合框选项的值,但是当它进行回发时,默认值被发布而不是新的(即使在回发发生之前显示了新值)。
我发现如果我注入新值,那么只需给组合框一个物理点击并继续测试,回发就会发布正确的值。
我假设物理点击调用javascript函数来更新字段,但我似乎无法弄清楚我应该在我的测试中调用什么函数。
我很感激任何建议!
干杯乔恩
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
最满意答案
var extender = $find("ctl00_SampleContent_ComboBox1"); extender.get_textBoxControl().value = "Bravo"; extender._onTextBoxBlur();在此页面上运行良好: http : //www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx
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
更多推荐
发布评论