我想在Selenium中找到一些元素,并且遇到问题。 还有像ID没有正常的元件等无法找到Selenium中的按钮和href
问题没有1 - >应点击继续按钮
<a _ngcontent-c3="" routerlink="cms" href="/cms">Continue</a>
问题无2 - >应该点击添加按钮
<button _ngcontent-c11="" aria-label="Add user" class="action-btn add" type="button">
我尝试使用PartialLinkText的fidning元素,我试图让自己的CSS选择器/ xPath,但测试用例总是失败...
一个不成功的解决方案的问题1:
WebElement continueButton = driver.findElement(By.partialLinkText("Continue"));
continueButton.click();
有什么建议? 谢谢。
你可以发布错误吗? – NarendraR
嗨,这里是错误的截图: 继续 - 问题 - https://i.stack.imgur.com/zVWkm.png 添加按钮 - 问题 - https://i.stack.imgur.com/AAfYq.png – Pinky