【发布时间】:2019-03-28 23:10:27
【问题描述】:
我正在尝试从网站上自动化几个 Selenium-TestNg 场景 - http://ecommerce.saipratap.net/checkpersonaldetail.php
我试图单击“继续”按钮,但它似乎是一个图像。 下面是代码的sn-p。如何编写相同的xpath?
尝试使用 xpath - //a[contains(@href,'checkoutshiping.php')],但没有成功
<a href="checkoutshiping.php"> ==$0
<img src="images/continue.gif" border="0"
style="cursor:hand;"> ==$0
</a>
【问题讨论】:
-
共享错误可能是等待问题?
-
我收到以下异常 - org.openqa.selenium.NoSuchElementException: Cannot locate an element using xpath=//a[@href='checkoutshiping.php'] 有关此错误的文档,请访问:seleniumhq.org/exceptions/no_such_element.html 构建信息:版本:'3.141.59',修订:'e82be7d358',时间:'2018-11-14T08:25:48' 系统信息:主机:'LENOVO',ip:'192.168.1.101 ', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201' 驱动信息: driver.version: RemoteWebDriver
-
@ChaitanyaMaligi 而不是发布 错误堆栈跟踪 作为评论,这应该是对主要问题的编辑,以便贡献者可以更好地了解您的问题。