Note that there are some explanatory texts on larger screens.

plurals
  1. POWatir: Need to double click on an element to open custom popup
    primarykey
    data
    text
    <p>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.</p> <p>Added 6 July 2010:</p> <p>I solved it but I have another query now. </p> <p>Below was the HTML for which I was able to solve using "@ie.div(:class,'GridElementInlineIE').fire_event('ondblclick') "</p> <hr> <pre><code>&lt;div class="gridViewItem" style='display: inline-table;' ondblclick='openAsset("634119577077187500", "", "LIBRARY_ASSETS_TAB", "1", "A111");' id='GridComponent634119577077187500'&gt; &lt;table style="display: inline-table;" class="gridViewItemTable" cellpadding="0" cellspacing="0" onclick="highlightAsset(this, event)" projectid="" dmguid="634119577077187500" id="_thumb_634119577077187500" objectclass="VIDEO"&gt; &lt;tr&gt; &lt;td style="padding: 10px 10px 0px 7px"&gt; &lt;img class="assetListGridImage draggableThumbnail" id="thumb_634119577077187500" title="A111" alt="A111" src="/images/wait.gif" dmguid="634119577077187500" projectid="" objectclass="VIDEO" _onclick="highlightAsset(this, event)" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="padding: 0px 0px 0px 7px"&gt; A111 &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="padding: 0px 0px 5px 7px; min-height: 33px; max-height: 33px; height: 33px;"&gt; &lt;img alt='Not starred' name='IMAGE634119577077187500' title='Star this asset' src='/Images/star_off.png' onclick='toggleStar(event, this, "634119577077187500")' class='starGrid' /&gt; &lt;img alt='video' title='video' src='/Images/asset_type/VIDEO.png'/&gt; &lt;img src='/images/shared.png' title ='Shared' alt='Shared' /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <hr> <p>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.</p> <pre><code> div class="GridElementInline"&gt; &lt;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"&gt; &lt;tr&gt; &lt;td style="padding: 10px 10px 0px 7px;"&gt; &lt;table id='tblBinlist2383' folderid='2383' projectId='' _onclick='highlightAsset(this, event)' ondblclick='showBinDetails("2383", "")' class='binThumbnail GridElementInline' cellpadding='0' cellspacing='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;img class='fourGridViewImage' src='http://stream.....' /&gt;&lt;/td&gt;&lt;td&gt;&lt;img class='fourGridViewImage' src='http://stream.....' /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;img class='fourGridViewImage' src='http://stream.....' /&gt;&lt;/td&gt;&lt;td&gt;&lt;img class='fourGridViewImage' src='http://stream.....' /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" align="center" style="padding: 10px 10px 0px 7px; font-size: 9px;white-space: nowrap;"&gt; &lt;div align="left" title="today"&gt; today &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload