在 [Selenium2 Robot Framework 文档][1] 中,Click Link 的指南是:
单击定位器标识的链接。链接的关键属性是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