2 回答
千巷猫影
TA贡献1829条经验 获得超7个赞
要处理动态元素,请引入WebDriverWait并等待元素elementToBeClickable然后单击。
试试下面的代码。
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[@class='fr mt-header']/a[@class='registrationBtn' and @title='Client-Patient Registration']")));
element.click()
或者
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[@class='fr mt-header']/a[@class='registrationBtn' and @title='Client-Patient Registration']/span[@class='reg_icon']")));
element.click()
添加回答
举报
0/150
提交
取消