0

I am writting automatic test for GWT application. And I try to double click on table element. I am using this code fo click:

  browser.element(:xpath, '/html/body/div[5]/div[2]/div/div/div/div[2]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/table/tbody[2]/tr[1]/td[1]/div').double_click

When this command is executed I get error like:

  Cannot perform native interaction: Could not load native events component

I have added this code to my script but this didn't help:\

  profile = Selenium::WebDriver::Firefox::Profile.new
  profile.native_events = true
  browser = Watir::Browser.new :firefox, :profile => profile

It is part of html where I try to click:

<tbody>
  <tr aria-posinset="0" aria-setsize="11" role="listitem">
    <td class="cellSelected" height="22" align="left" style="padding-top: 0px; padding-bottom: 0px; width: 100px; overflow: hidden;">
      <div style="overflow:hidden;WIDTH:96px;" cellclipdiv="true" role="presentation">
        <nobr>2004</nobr>
      </div>
    </td>
    <td class="cellSelected" height="22" align="left" style="padding-top: 0px; padding-bottom: 0px;  width: 371px; overflow: hidden;">
      <div style="overflow:hidden;WIDTH:367px;" cellclipdiv="true" role="presentation">
    </td>
    <td class="cellSelected" height="22" align="right" style="padding-top: 0px; padding-bottom: 0px; width: 200px; overflow: hidden;">
    <td class="cellSelected" height="22" align="left" style="padding-top: 0px; padding-bottom: 0px; width: 372px; overflow: hidden;">
  </tr>
  <tr aria-posinset="1" aria-setsize="11" role="listitem">
  <tr aria-posinset="2" aria-setsize="11" role="listitem">
  <tr aria-posinset="3" aria-setsize="11" role="listitem">
  <tr aria-posinset="4" aria-setsize="11" role="listitem">
  <tr aria-posinset="5" aria-setsize="11" role="listitem">
  <tr aria-posinset="6" aria-setsize="11" role="listitem">
  <tr aria-posinset="7" aria-setsize="11" role="listitem">
  <tr aria-posinset="8" aria-setsize="11" role="listitem">
  <tr aria-posinset="9" aria-setsize="11" role="listitem">
  <tr aria-posinset="10" aria-setsize="11" role="listitem">
</tbody>

I know the xpath is not preety but it work. For example regular click work normaly.

I use selenium 2.31, ruby 1.9.3 and firefox 17.


Here is div and table. Thanks

   <div id="isc_K7" style="POSITION:relative;VISIBILITY:inherit;Z-INDEX:206084;CURSOR:default;"  eventproxy="isc_PolicyListGrid_1_body">
   <div style="position:relative;z-index:1000;">
     <div id="isc_PolicyListGrid_1_body$47a" style="width:1px;height:0px;overflow:hidden;display:none;">
     <img width="1" height="0" border="0" align="TEXTTOP" suppress="TRUE" src="blank.gif">
     </div>
     <table id="isc_K7table" class="listTable" width="1043" cellspacing="0" cellpadding="2"  border="0" style="table-layout:fixed;overflow:hidden;wrap:false;padding-left:0px;padding-right:0px;" role="presentation">
        <tbody></tbody>
        <colgroup>
        <tbody>
     </table>
   <div id="isc_PolicyListGrid_1_body$47t" style="width:1px;height:0px;overflow:hidden;display:none;">
   </div>
   <table style="position:absolute;top:0px;font-size:1px;height:100%;width:100%;z-index:1;overflow:hidden;visibility:hidden;">
  </div>
ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
user2239655
  • 830
  • 2
  • 11
  • 28
  • 1
    Is this different than your previous question [Native Events error trying to double-click element using watir-webdriver](http://stackoverflow.com/questions/15783528/native-events-error-trying-to-double-click-element-using-watir-webdriver)? – Justin Ko Apr 12 '13 at 12:52
  • Yes In previus question Chuck van der Linden wrote: "Start a new question, include some of the HTML for the table where that div lives" So i did this. – user2239655 Apr 13 '13 at 14:20
  • That was in reference to how to best select the element, without using xpath, in a way that would not be brittle and break at the slightest change of the page by a developer.. We can edit this question to reflect that, and answer that aspect of your question. – Chuck van der Linden Apr 15 '13 at 19:20
  • There are very little handy identifiers in the HTML you presented, can you include the tags for the table, and the div that holds it? – Chuck van der Linden Apr 15 '13 at 22:30

0 Answers0