2016-09-02 57 views
0

從現在開始的幾天我試圖爲數據結構樹編寫硒ide測試。我堅持擴展樹節點,最主要的是有很多TreeExpandoIcons具有相同的類,沒有id,文本,類型等等。selenium ide數據結構樹展開

<tbody> 
<tr> 
<td title="Control + right arrow key to expand this row." aria-expanded="false" aria-readonly="true" role="gridcell" tabindex="-1" aria-describedby="RestartPageGrid-Id" colid="Id" class="gridxCell" style="width:auto;min-width:auto;max-width:auto;"> 
<div class="gridxTreeExpandoCell " style="padding-left: 16px;"> 
<div class="gridxTreeExpandoIcon " style="margin-left: 0px;"> 
<div class="gridxTreeExpandoInner">+</div></div> 
<div class="gridxTreeExpandoContent gridxCellContent">1</div> 
</div> 
</td> 

始終只有一個圖標之間的差異,近圖標gridxCellContent數。但它只是靠近,不可點擊。也許你知道一些解決方法或如何解決這個問題?我會非常感激。

我的硒IDE計劃書,寫這樣的:

<tr> 
    <td>click</td> 
    <td>css=div.gridxTreeExpandoIcon.</td> 
    <td></td> 
</tr> 

但這種代碼是行不通的。

回答

0

有幾個問題我有: 1.你有沒有嘗試刪除最後(。)在CSS選擇器? 2.我也看到 「gridxTreeExpandoIcon」類有一個尾隨空間。 你知道使用包含在CSS選擇器? 3.您是否嘗試過使用不同的位置策略? 如xpath,// div [包含(@ class,'gridxTreeExpandoIcon')]

+0

謝謝,試圖幫助我。我應該在Click()上使用ClickAt()。 – Satnam

+0

@satnam對我的問題有任何反饋? ClickAt()如何解決它。請添加解釋。如果我的回答有任何幫助,請立即投票。 – stupidnetizen