I don't see any onmouseover stuff in the code you presented. I do see onmousedown
perhaps try firing that first, against the z-tree div itself? The other thing is, do you know it's always the first div of class z- tree-cell-cnt If so the other contents don't matter, just address things starting from the first index of a div of that class. Otherwise if it's the first time you see the close arrow then go for the first instance of that div to get your element element = browser.div(:class ==> "z-tree-ico z-tree-root- close", :index ==> 0) On Apr 13, 7:36 am, Francisco Diaz Trepat - gmail <[email protected]> wrote: > Hi guys I am trying to do a select on a patient by which I need to do a > double click on a table row. > > The ZK part is this: > > public void render(Treeitem item, Object data) throws Exception { > blah blah... some code.... > item.getTreerow().addEventHandler("onDoubleClick", new EventHandler(new > ZScript( > null, "java", > "ar.com.eoc.hco.util.ComponentsUtil.getContainerWindow(self).doAction(self.parent.value)", > null), > null)); > blah blah some other code. > > My latest futile (that I read on some blog about doing first a onmouseover > and then the doubleclick) try is: > > if(@browser.div(:class, "z-window-modal").divs(:class, > "z-tree-cell-cnt")[0].exist? and @browser.div(:class, > "z-window-modal").div(:text, patient_medical_record.to_s).exist?) then > #this element holds a small right pointing arrow that collapses when > clicked, but also is the first left most element in the row. > element = @browser.div(:class, "z-window-modal").divs(:class, > "z-tree-cell-cnt")[0].span(:class, "z-tree-ico z-tree-root-close") > sleep 3 > #element.parent.parent.parent.click > puts "First OnClick Fired" > element.parent.parent.parent.fire_event("onmouseover", 1) > element.parent.parent.parent.fire_event("ondblclick", 1) > > sleep 5 > end > > This throws a JavaScript Error: > > For input string: "NaN" > > Any Ideas? How about trying to execute the javascript function delegate for > the event? > > Please I really need Urgent help, I am working on an Ubuntu 10.10 64 machine > and I am not used to the WebDriver limitations, although I have been able to > advance pretty well, but not on this double click issue. > > The HTML is awful really really awful, I am new to this project and I am > only here to test it via Watir: > > <div class="z-center-body" id="z_4e_ve1!cave" style="width: 1913px; height: > 406px;"> > <div style="height: 100%;" id="z_4e_0f1"> > <div onselectstart="return false;" onmousedown="return false" > z.fixed="false" z.tchsib="z_4e_ef1" z.vflex="true" z.selid="zk_n_a" > z.size="0" z.zcls="z-tree" style="height: 90%; background: none repeat > scroll 0% 0% rgb(255, 255, 255);" class="z-tree" z.type="zul.tree.Tree" > id="z_4e_1f1" zk_realsize="17"> > > <div class="z-tree-header" id="z_4e_1f1!head" style="width: 1911px;"> > <table cellspacing="0" cellpadding="0" border="0" width="100%" > style="table-layout: fixed; width: 1911px;"> > <tbody style="visibility: hidden; height: 0px;"> > <tr class="z-tree-faker" id="z_4e_2f1!hdfaker"> > <th z.zcls="z-tree-col" style="width: 954px;" class="z-tree-col" > id="z_4e_3f1!hdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 287px;" class="z-tree-col" > id="z_4e_4f1!hdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 96px;" class="z-tree-col" > id="z_4e_5f1!hdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 478px;" class="z-tree-col" > id="z_4e_6f1!hdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 96px;" class="z-tree-col" > id="z_4e_7f1!hdfaker"> > <div style="overflow: hidden;"></div> > </th> > </tr> > </tbody> > <tbody><tr align="left" z.rid="z_4e_1f1" z.zcls="z-tree-cols" > class="z-tree-cols" z.type="Tcols" id="z_4e_2f1"> > <th z.zcls="z-tree-col" style="width: 948px;" class="z-tree-col" > z.type="Tcol" id="z_4e_3f1"><div class="z-tree-col-cnt" id="z_4e_3f1!cave" > style="width: 948px;">Name</div></th> > <th z.zcls="z-tree-col" style="width: 281px;" class="z-tree-col" > z.type="Tcol" id="z_4e_4f1"><div class="z-tree-col-cnt" id="z_4e_4f1!cave" > style="width: 281px;">DOB</div></th> > <th z.zcls="z-tree-col" style="width: 90px;" class="z-tree-col" > z.type="Tcol" id="z_4e_5f1"><div class="z-tree-col-cnt" id="z_4e_5f1!cave" > style="width: 90px;">Gender</div></th> > <th z.zcls="z-tree-col" style="width: 472px;" class="z-tree-col" > z.type="Tcol" id="z_4e_6f1"><div class="z-tree-col-cnt" id="z_4e_6f1!cave" > style="width: 472px;">Medical Record Number</div></th> > <th z.zcls="z-tree-col" style="width: 90px;" class="z-tree-col" > z.type="Tcol" id="z_4e_7f1"><div class="z-tree-col-cnt" id="z_4e_7f1!cave" > style="width: 90px;"></div></th> > </tr> > </tbody></table> > </div> > > <div class="z-tree-body" id="z_4e_1f1!body" style="height: 343px; width: > 1911px;"> > <table cellspacing="0" cellpadding="0" border="0" width="100%" style="width: > 1911px;"> > <tbody style="visibility: hidden; height: 0px;"> > <tr class="z-tree-faker" id="z_4e_2f1!bdfaker"> > <th z.zcls="z-tree-col" style="width: 954px;" class="z-tree-col" > id="z_4e_3f1!bdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 287px;" class="z-tree-col" > id="z_4e_4f1!bdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 96px;" class="z-tree-col" > id="z_4e_5f1!bdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 478px;" class="z-tree-col" > id="z_4e_6f1!bdfaker"> > <div style="overflow: hidden;"></div> > </th> > <th z.zcls="z-tree-col" style="width: 96px;" class="z-tree-col" > id="z_4e_7f1!bdfaker"> > <div style="overflow: hidden;"></div> > </th> > </tr> > </tbody> > <tbody z.zcls="z-tree-children" class="z-tree-children" id="z_4e_ef1"> > <tr z.visible="true" z.dbclk="true" z.lod="t" z.tchsib="z_4e_u32" > z.ptch="z_4e_ef1" z.rid="z_4e_1f1" z.pitem="z_4e_n32" z.zcls="z-tree-row" > class="z-tree-row" z.type="Trow" id="z_4e_o32"> > <td z.zcls="z-tree-cell" style="width: 50%;" class="z-tree-cell" > id="z_4e_p32" z.type="Lic"><div class="z-tree-cell-cnt" > id="z_4e_p32!cave"><span id="z_4e_o32!open" z.type="Tcop" class="z-tree-ico > z-tree-root-close" z.fc="t"></span>Hutchison, Robb </div></td> > <td z.zcls="z-tree-cell" style="width: 15%;" class="z-tree-cell" > id="z_4e_q32" z.type="Lic"><div class="z-tree-cell-cnt" > id="z_4e_q32!cave">06/21/1970</div></td> > <td z.zcls="z-tree-cell" style="width: 5%;" class="z-tree-cell" > id="z_4e_r32" z.type="Lic"><div class="z-tree-cell-cnt" > id="z_4e_r32!cave">M</div></td> > <td z.zcls="z-tree-cell" style="width: 25%;" class="z-tree-cell" > id="z_4e_s32" z.type="Lic"><div class="z-tree-cell-cnt" > id="z_4e_s32!cave"> </div></td> > <td z.lfclk="true" z.zcls="z-tree-cell" style="width: 5%; color: blue;" > class="z-tree-cell" id="z_4e_t32" z.type="Lic"><div class="z-tree-cell-cnt" > style="color: blue;" id="z_4e_t32!cave">Edit</div></td> > </tr></tbody> > </table><a style="position: absolute; left: 0px; top: 0px; padding: 0pt ! > important; margin: 0pt ! important; border: 0pt none ! important; > background: none repeat scroll 0% 0% transparent ! important; font-size: 1px > ! important; width: 1px ! important; height: 1px ! important; outline: 0pt > none; -moz-user-select: text;" href="javascript:;" onclick="return false;" > tabindex="-1" id="z_4e_1f1!a" z.keyevt="true"></a> > </div> > > </div> > <div z.numpg="1" z.actpg="0" z.zcls="z-paging" style="display: none;" > class="z-paging" z.type="zul.pg.Pg" name="z_4e_8f1" id="z_4e_8f1"> > <table cellspacing="0"> > <tbody> > <tr> > <td> > <table cellspacing="0" cellpadding="0" border="0" class="z-paging-btn > z-paging-btn-disd" name="z_4e_8f1!tb_f" id="z_4e_8f1!tb_f"> > <tbody> > <tr> > <td><div><button class="z-paging-first" type="button"> </button></div></td> > </tr> > </tbody> > </table> > </td> > <td> > <table cellspacing="0" cellpadding="0" border="0" class="z-paging-btn > z-paging-btn-disd" name="z_4e_8f1!tb_p" id="z_4e_8f1!tb_p"> > <tbody> > <tr> > <td><div><button class="z-paging-prev" type="button"> </button></div></td> > </tr> > </tbody> > </table> > </td> > <td><span class="z-paging-sep"></span></td> > <td><span class="z-paging-text"></span></td> > <td><input type="text" size="3" value="1" class="z-paging-inp" > name="z_4e_8f1!real" id="z_4e_8f1!real"></td> > <td><span class="z-paging-text">/ 1</span></td> > <td><span class="z-paging-sep"></span></td> > <td> > <table cellspacing="0" cellpadding="0" border="0" class="z-paging-btn > z-paging-btn-disd" name="z_4e_8f1!tb_n" id="z_4e_8f1!tb_n"> > <tbody> > <tr> > <td><div><button class="z-paging-next" type="button"> </button></div></td> > </tr> > </tbody> > </table> > </td> > <td> > <table cellspacing="0" cellpadding="0" border="0" class="z-paging-btn > z-paging-btn-disd" name="z_4e_8f1!tb_l" id="z_4e_8f1!tb_l"> > <tbody> > <tr> > <td><div><button class="z-paging-last" type="button"> </button></div></td> > </tr> > </tbody> > </table> > </td> > </tr> > </tbody> > </table> > > <div class="z-paging-info" id="z_4e_8f1!info">[ 1 - 1 / 1 ]</div> > > </div></div> > </div> -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
