关注由 select_list 值生成的窗口

发布于 2024-12-20 12:59:22 字数 578 浏览 3 评论 0原文

我正在测试的网站有一个页面,当 选择指定的 select_list 值。迄今为止,我从来没有能够 自动化此操作,多年来我一直将其作为手动步骤 直到我能弄清楚。 select_list 的 HTML 示例 问题是这样的:

<select name="cboFoo" class="txtboxwidth left" id="cboFoo" 
onchange="javascript:setTimeout('__doPostBack(\'cboFoo\',\'\')', 0)" 
jQueryXXXXXXXXXXXXXXXXXXXX="7"> 

考虑到 click_no_wait 在我们网站的其他地方工作得足够好 对于 javascript 确认等,我希望以下内容 为 select_list 工作;但事实并非如此。新的数据窗口从未 出现:

browser.select_list(:id, "cboFoo").select_no_wait("Bar") 

我欢迎任何建议,因为这是目前我们唯一的领域 我无法自动化的网站。

谢谢,

GJHmf

The site I'm testing has a page that spawns a new data window when a
specified select_list value is chosen. To date, I've never been able
to automate this, and I've been having this as a manual step for ages
until I can figure it out. Example HTML for the select_list in
question is as such:

<select name="cboFoo" class="txtboxwidth left" id="cboFoo" 
onchange="javascript:setTimeout('__doPostBack(\'cboFoo\',\'\')', 0)" 
jQueryXXXXXXXXXXXXXXXXXXXX="7"> 

Considering a click_no_wait works well enough elsewhere in our site
for javascript confirmations and suchlike, I hoped the following would
work for a select_list; but it doesn't. The new data window never
appears:

browser.select_list(:id, "cboFoo").select_no_wait("Bar") 

I welcome any suggestions, as this is currently the only area of our
site I can't automate.

Thanks,

GJHmf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Saygoodbye 2024-12-27 12:59:22

由于控件正在寻找“onchange”事件,因此您可能需要进行选择,然后针对该元素触发该事件以调用 javascript。

browser.select_list(:id, "cboFoo").select('Bar')
browser.select_list(:id, "cboFoo").fire_event('onchange')

如果不是这样,请按照问题评论中的要求提供更多信息。

Since the control is looking for an 'onchange' event, you may need to make your selection and then fire that event against that element to get the javascript to invoke.

browser.select_list(:id, "cboFoo").select('Bar')
browser.select_list(:id, "cboFoo").fire_event('onchange')

If that's not it, then please provide more info as requested in the comments to the question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文