【发布时间】:2017-08-17 00:44:47
【问题描述】:
在[Selenium2 Robot Framework 文档][1]中,点击链接的指南是:
点击定位器标识的链接。链接的关键属性是 id, name、href 和链接文本。有关定位的详细信息,请参阅简介 元素。
我尝试过使用 href 标记插入 URL 的不同方法,但仍然无法正常工作。请问我可以举一个例子吗?我无法使用链接文本,因为我有多个链接具有相同的文本(不幸的是名为“创建”),并且它们没有任何元素 ID 可供我参考。
我收到了这个错误:
ValueError: Element locator with prefix 'href' is not supported
提前致谢!
这是我的代码:
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Test1
[Documentation] Try to login
Open Browser {my login page by i cant post more than 2 links here. it's working fine here} CHROME
Input Text //*[@id="rightColum"]/table/tbody/tr/td[2]/table/tbody/tr/td/form/table/tbody/tr[1]/td[2]/input username
Input Password //*[@id="rightColum"]/table/tbody/tr/td[2]/table/tbody/tr/td/form/table/tbody/tr[2]/td[2]/input password
Click Button //*[@id="Login2"]
Click Link href=https://test/enquire.aspx
【问题讨论】:
-
你能添加你试过的代码吗?
标签: selenium robotframework robotframework-ide