首页 文章

无法在Selenium中单击弹出窗口上的元素

提问于
浏览
-1

enter image description here

http://automationpractice.com/index.php?id_category=9&controller=category

我正在使用Selenium Webdriver自动化网页 . 我无法使用简单的元素定位器方法单击模式弹出窗口的按钮 . 例 .

  • 打开http://automationpractice.com

  • 单击"Add to Cart" .

  • 现在有一个弹出窗口,其中有"Checkout"按钮 . 我需要点击这个"Proceed to checkout"按钮 .

我试过switchTo()windowhandle但没有任何效果 .

1 回答

  • 0

    这是正常的,没有任何警报代码 . 只需直接识别元素即可 . 只需使用显式等待即可 .

相关问题