我想单击查看更多按钮,直到看到某个链接文本元素,然后单击该链接文本。我将如何创建该循环?我尝试了其他方法,但仍然无法正确完成:
WebElement viewmorebutton = wdriver.findElement(By.xpath(".//*[@id='content']/input"));
while(checkButton(viewmorebutton)){
wdriver.findElement(By.id(TransationListingWeb.getView_more_transactions_button_id())).click();
if( wdriver.findElement(By.linkText("LOTTO (20-03-2019)")).isDisplayed()){
wdriver.findElement(By.linkText("LOTTO (20-03-2019)")).click();
}else
wdriver.findElement(By.id(TransationListingWeb.getView_more_transactions_button_id())).click();
}