我需要點擊一個表中的鏈接,其ID是動態生成的。我想單擊基於同一行其他列中文本的鏈接。嘗試下面的代碼,但不成功點擊硒動態鏈接
selenium.GetValue( 「//表[@ ID =表格ID]/tbody的/ TR [TD /一個/文本()= '測試']」)
還與試圖下面的代碼: Selenium.click(「xpath = id(TableID)/ tbody/tr [td/text()='Testing'] //輸入[@值=代碼,但只能通過指定靜態行ID
Dim NumOfRows As Integer = selenium.GetXpathCount("//table[@id='up']/tbody/tr")
'Dim index As Integer
Dim ReturnValue As Integer
Dim IsFound As Boolean = False
Console.WriteLine(NumOfRows)
For i As Integer = 1 To NumOfRows
Dim strColumnText As String = selenium.GetText("//table[@id='up']/tbody/tr[i]/td[1]")
'selenium.WaitForCondition(strt, 100000)
If (strColumnText = pord) Then
ReturnValue = i
IsFound = True
Exit For
End If
Next
如果我指定精確的行會找到它的元素,但在廁所不能正常工作頁。請幫助
對於作爲答案,你需要提供輸入樣本的XPath表達式。 – 2011-01-17 15:44:16