如何通过robotframework在https://github.com/robotframework/SeleniumLibrary/上单击“克隆或下载”按钮?

时间:2019-01-10 00:59:26

标签: selenium-webdriver xpath webdriver robotframework

我正在尝试自动从github下载回购。我无法单击clone or download按钮的元素。

代码试用:

open browser              https://github.com/robotframework/SeleniumLibrary/    chrome

Click Element             //a[contains(@class,'btn btn-sm btn-primary')]

HTML:

<summary class="btn btn-sm btn-primary">
    Clone or download
    <span class="dropdown-caret"></span>
  </summary>

1 个答案:

答案 0 :(得分:0)

要单击文本为克隆或下载的元素,可以使用以下解决方案:

open browser              https://github.com/robotframework/SeleniumLibrary/    chrome
Click Element             //summary[@class='btn btn-sm btn-primary']