1. <tfoot id='h5ouQ'></tfoot>

    • <bdo id='h5ouQ'></bdo><ul id='h5ouQ'></ul>

    <small id='h5ouQ'></small><noframes id='h5ouQ'>

    <legend id='h5ouQ'><style id='h5ouQ'><dir id='h5ouQ'><q id='h5ouQ'></q></dir></style></legend>
  2. <i id='h5ouQ'><tr id='h5ouQ'><dt id='h5ouQ'><q id='h5ouQ'><span id='h5ouQ'><b id='h5ouQ'><form id='h5ouQ'><ins id='h5ouQ'></ins><ul id='h5ouQ'></ul><sub id='h5ouQ'></sub></form><legend id='h5ouQ'></legend><bdo id='h5ouQ'><pre id='h5ouQ'><center id='h5ouQ'></center></pre></bdo></b><th id='h5ouQ'></th></span></q></dt></tr></i><div id='h5ouQ'><tfoot id='h5ouQ'></tfoot><dl id='h5ouQ'><fieldset id='h5ouQ'></fieldset></dl></div>

      Watir:需要双击一个元素才能打开自定义弹出窗口

      时间:2023-10-01
        <tbody id='5x8ca'></tbody>

      <small id='5x8ca'></small><noframes id='5x8ca'>

          <bdo id='5x8ca'></bdo><ul id='5x8ca'></ul>

          <legend id='5x8ca'><style id='5x8ca'><dir id='5x8ca'><q id='5x8ca'></q></dir></style></legend>

            <tfoot id='5x8ca'></tfoot>

            1. <i id='5x8ca'><tr id='5x8ca'><dt id='5x8ca'><q id='5x8ca'><span id='5x8ca'><b id='5x8ca'><form id='5x8ca'><ins id='5x8ca'></ins><ul id='5x8ca'></ul><sub id='5x8ca'></sub></form><legend id='5x8ca'></legend><bdo id='5x8ca'><pre id='5x8ca'><center id='5x8ca'></center></pre></bdo></b><th id='5x8ca'></th></span></q></dt></tr></i><div id='5x8ca'><tfoot id='5x8ca'></tfoot><dl id='5x8ca'><fieldset id='5x8ca'></fieldset></dl></div>
              1. 本文介绍了Watir:需要双击一个元素才能打开自定义弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我是 WATIR 的新手.我面临的问题是——我正在测试的应用程序在页面上放置了缩略图(如 Windows 图标),我需要双击它.这样做时,将打开一个自定义弹出窗口(用 javascript 实现的 ajax 弹出窗口).fire_event("ondblclick") 对我不起作用.我也尝试了两次点击",但这也无济于事.有没有其他方法来处理这个?非常感谢您的帮助.

                I am a newbie in WATIR. The problem I am facing is - The application I am testing has thumbnails (like Windows icons) placed on the page and I need to double click it. On doing that, an custom popup (ajax popup implemented in javascript) will open. The fire_event("ondblclick") is not working for me. I also tried 'click' twice but that too is not helping. Is there any other way of handling this? Your help is highly appreciated.

                2010 年 7 月 6 日添加:

                Added 6 July 2010:

                我解决了,但我现在有另一个问题.

                I solved it but I have another query now.

                以下是我能够使用@ie.div(:class,'GridElementInlineIE').fire_event('ondblclick')"解决的 HTML

                Below was the HTML for which I was able to solve using "@ie.div(:class,'GridElementInlineIE').fire_event('ondblclick') "

                <div class="gridViewItem" style='display: inline-table;' ondblclick='openAsset("634119577077187500", "", "LIBRARY_ASSETS_TAB", "1", "A111");'
                        id='GridComponent634119577077187500'>
                        <table style="display: inline-table;" class="gridViewItemTable" cellpadding="0" cellspacing="0"
                            onclick="highlightAsset(this, event)" projectid="" dmguid="634119577077187500"
                            id="_thumb_634119577077187500" objectclass="VIDEO">
                            <tr>
                                <td style="padding: 10px 10px 0px 7px">
                                    <img class="assetListGridImage draggableThumbnail" id="thumb_634119577077187500"
                                        title="A111" alt="A111"
                                        src="/images/wait.gif" dmguid="634119577077187500" projectid=""
                                        objectclass="VIDEO" _onclick="highlightAsset(this, event)" />
                                </td>
                            </tr>
                            <tr>
                                <td style="padding: 0px 0px 0px 7px">
                
                                    A111
                                </td>
                            </tr>
                            <tr>
                                <td style="padding: 0px 0px 5px 7px; min-height: 33px; max-height: 33px; height: 33px;">
                                    <img alt='Not starred' name='IMAGE634119577077187500' title='Star this asset' src='/Images/star_off.png' onclick='toggleStar(event, this, "634119577077187500")' class='starGrid' />
                                    <img alt='video' title='video' src='/Images/asset_type/VIDEO.png'/>
                                    <img src='/images/shared.png'  title ='Shared' alt='Shared' />
                                </td>
                
                            </tr>
                        </table>
                    </div>
                

                <小时>

                现在我需要双击这个项目(下面的代码).但即使正在识别元素(以黄色突出显示),双击也不起作用.我正在尝试@ie.div(:class,'gridViewItem').fire_event('ondblclick')".我也尝试过 while 循环和单击两次选项无效.我正在使用带有 Ruby186-27_rc2 的 Watir 1.6.


                Now I need to double click on this item (code below). But even though the element is being identified (highlighted with a yellow), the double click is not working. I am trying "@ie.div(:class,'gridViewItem').fire_event('ondblclick')". I've also tried the while loops and click-twice options to no effect. I'm using Watir 1.6 with Ruby186-27_rc2.

                           div class="GridElementInline">
                                <table class="GridElementInline" style="border: solid 2px #1e606e;min-height:134px;height:134px;max-height: 134px" onclick="highlightAsset(this, event)"
                                                                projectid='' folderid="2383" id="_tblBinlist2383" title = "today">
                                    <tr>
                                        <td style="padding: 10px 10px 0px 7px;">
                                            <table id='tblBinlist2383' folderid='2383' projectId='' _onclick='highlightAsset(this, event)' ondblclick='showBinDetails("2383", "")' class='binThumbnail GridElementInline' cellpadding='0' cellspacing='0'><tr><td><img class='fourGridViewImage' src='http://stream.....' /></td><td><img class='fourGridViewImage' src='http://stream.....' /></td></tr><tr><td><img class='fourGridViewImage' src='http://stream.....' /></td><td><img class='fourGridViewImage' src='http://stream.....' /></td></tr></table>
                                        </td>
                                    </tr>
                                <tr>
                                <td colspan="2" align="center" style="padding: 10px 10px 0px 7px; font-size: 9px;white-space: nowrap;">
                                <div align="left" title="today">
                                    today
                                </div>
                                </td>
                                </tr>
                                </table>
                            </div>
                

                推荐答案

                我为 Windows 中的 Watir 1.6.7 做了一个优雅的解决方案.

                There's one elegant solution I did for Watir 1.6.7 in Windows.

                我去了 ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb (你的路径可能会改变,但主要思想是访问watir库并修改element.rb 文件).

                I went to ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb (your path may change, but the main idea is to access the watir library and modify the element.rb file).

                我添加了这些行:

                def fire_event_no_wait(event)
                  assert_exists
                  assert_enabled
                  highlight(:set)
                  element = "#{self.class}.new(#{@page_container.attach_command}, :unique_number, #  {self.unique_number})"
                  ruby_code = "require 'rubygems';" <<
                          "require '#{File.expand_path(File.dirname(__FILE__))}/core';" <<
                          "#{element}.fire_event("#{event}")"
                  system(spawned_click_no_wait_command(ruby_code))
                  highlight(:clear)
                end
                

                这将创建一个名为 fire_event_no_wait 的方法,其行为类似于 watir 中的 click_no_wait.

                this will create a method called fire_event_no_wait that behaves just like click_no_wait in watir.

                希望这可以帮助任何人.

                Hope this helps anyone out.

                这篇关于Watir:需要双击一个元素才能打开自定义弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:window.open 在 chrome 扩展中返回 undefined 下一篇:显示一个弹出窗口,其中包含来自 react.js 中的一个表的元素及其总数的信息

                相关文章

                  <legend id='G0C2v'><style id='G0C2v'><dir id='G0C2v'><q id='G0C2v'></q></dir></style></legend>

                  <small id='G0C2v'></small><noframes id='G0C2v'>

                      <bdo id='G0C2v'></bdo><ul id='G0C2v'></ul>

                    <tfoot id='G0C2v'></tfoot>
                    <i id='G0C2v'><tr id='G0C2v'><dt id='G0C2v'><q id='G0C2v'><span id='G0C2v'><b id='G0C2v'><form id='G0C2v'><ins id='G0C2v'></ins><ul id='G0C2v'></ul><sub id='G0C2v'></sub></form><legend id='G0C2v'></legend><bdo id='G0C2v'><pre id='G0C2v'><center id='G0C2v'></center></pre></bdo></b><th id='G0C2v'></th></span></q></dt></tr></i><div id='G0C2v'><tfoot id='G0C2v'></tfoot><dl id='G0C2v'><fieldset id='G0C2v'></fieldset></dl></div>