【发布时间】:2016-03-21 17:35:43
【问题描述】:
我在网站上有表。表格允许通过按 Shift 键 + 向下箭头键选择多行。
我正在尝试使用 selenium webdriver 执行相同的操作,但它没有逐一选择行,它选择行然后取消选择它并转到下一个....
我的代码:
List<WebElement> TRcount = driver.findElements(By.tagName("tr"));
int x;
for(x=0;x<TRcount.size();x++)
{
Actions rows = new Actions(Base.getdriver());
rows.keyDown(TRcount.get(x),Keys.SHIFT).keyUp(TRcount.get(x+1), Keys.SHIFT).build();
rows.build().perform();
TRcount.get(x).click();
}
【问题讨论】:
-
你能分享你的网站链接吗?