51Testing软件测试论坛
标题:
怎么Click Formpane里面的一行数据
[打印本页]
作者:
luocb1980
时间:
2010-9-1 16:52
标题:
怎么Click Formpane里面的一行数据
在ExtJS里面有一个对象是FormPane,在触发相应的事情后生成了如下的grid data
D:\Test\1.jpg
如果是手工的话,doubleClick 会pop up 一个window,列出详细的信息
但是通过selenium就不能产生这个doubleClick的动作。我的代码段如下:
if (selenium.isTextPresent("NSE_STK_WIPR")) {
selenium.click("//td[contains(@class, 'x-grid3-col x-grid3-cell x-grid3-td-1')]/descendant::div[contains(@class, 'x-grid3-cell-inner x-grid3-col-1')][text()='NSE_STK_WIPR']/ancestor-or-self::td[contains(@class, 'x-grid3-col x-grid3-cell x-grid3-td-1')]/following-sibling::td[contains(@class, 'x-grid3-col x-grid3-cell x-grid3-td-checker x-grid3-cell-last')]/div[contains(@class, 'x-grid3-cell-inner x-grid3-col-checker')]/div");
selenium.click("updateButton");
} else {
System.out.println("No NSE_STK_WIPR");
}
执行的结果是直接执行了selenium.click("updateButton");
doubleClick 没有任何效果。
请问有人知道这种现象吗?
作者:
luocb1980
时间:
2010-9-1 16:53
我通过firebug取道这部分html代码
<div style="width: 1043px;" class="x-grid3-row x-grid3-row-first x-grid3-row-selected">
<table cellspacing="0" cellpadding="0" border="0" style="width: 1043px;" class="x-grid3-row-table">
<tbody>
<tr>
<td tabindex="0" style="width: 21px;" class="x-grid3-col x-grid3-cell x-grid3-td-numberer x-grid3-cell-first ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-numberer">
<font style="color: blue;">1</font>
</div>
</td>
<td tabindex="0" style="width: 198px;" class="x-grid3-col x-grid3-cell x-grid3-td-1 ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-1">NSE_STK_WIPR</div>
</td>
<td tabindex="0" style="width: 198px;" class="x-grid3-col x-grid3-cell x-grid3-td-2 ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-2">NSE_STK_WIPR_ALIAS</div>
</td>
<td tabindex="0" style="width: 198px;" class="x-grid3-col x-grid3-cell x-grid3-td-3 ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-3">Alias automation</div>
</td>
<td tabindex="0" style="width: 198px;" class="x-grid3-col x-grid3-cell x-grid3-td-4 ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-4">XLE_AUTO_FM_ALIAS.P_AUTO_FM</div>
</td>
<td tabindex="0" style="width: 198px;" class="x-grid3-col x-grid3-cell x-grid3-td-5 ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-5">186</div>
</td>
<td tabindex="0" style="width: 18px;" class="x-grid3-col x-grid3-cell x-grid3-td-checker x-grid3-cell-last ">
<div unselectable="on" class="x-grid3-cell-inner x-grid3-col-checker">
<div class="x-grid3-row-checker"> </div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
作者:
luocb1980
时间:
2010-9-1 17:33
没人能解决吗?
作者:
wuxinof
时间:
2011-1-5 11:27
用class去定位一行数据是不行的,因为当鼠标放在一行数据的时候,其样式是会变化的,这样双击过去的就已经不是原来的数据了
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2