Ajax Control Toolkit ComboBox javascript更新/更改(Ajax Control Toolkit ComboBox javascript update/change

编程入门 行业动态 更新时间:2024-10-11 07:32:47
Ajax Control Toolkit ComboBox javascript更新/更改(Ajax Control Toolkit ComboBox javascript update/change)

我正在尝试编写自动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

更多推荐

本文发布于:2023-08-03 08:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1385396.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Toolkit   Control   Ajax   ComboBox   change

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!