我的用户界面看起来像:
我的HTML看起来像
我无法使用Selenium Web驱动程序单击模式对话框中的项目。
我尝试过下面的代码
List<WebElement> allBrancheRows=driver.findElements(By.xpath("table[@id='body_ucLookup1_grdData']tr"));
for(int i=2;i<=allBrancheRows.size();i++)
{
WebElement BranchColumn=driver.findElement(By.xpath("table[@id='body_ucLookup1_grdData']tr["+i+"]td[3]"));
if(BranchColumn.getText()=="NSW")
{
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", BranchColumn);
BranchColumn.click();
break;
}
}
i have tried using click() method as well before using JavaScript. Even this has not worked.
Please advise
使用此xpath应该可以使用。