【问题标题】:Robot framework with Selenium2Library - Is the syntax wrong?带有 Selenium2Library 的机器人框架 - 语法错误吗?
【发布时间】:2014-05-13 09:41:29
【问题描述】:

我刚开始使用 Robot Framework,我编写了应该通过但没有通过的简单测试。屏幕截图清楚地显示了这些元素在网站上。以下是几个例子:

Page Should Contain Element    name    websiteRegistration

Page Should Contain    Sign in and start watching

查找文本。

整个resource.txt描述如下:

*** Settings ***
Documentation     A resource file with reusable keywords and variables.
...
...               The system specific keywords created here form our own
...               domain specific language. They utilize keywords provided
...               by the imported Selenium2Library.
Library           Selenium2Library

*** Variables ***
${SERVER}    localhost:8080
${BROWSER}    Firefox
${DELAY}    20
${HOME URL}    http://${SERVER}/some-link-that-works

*** Keywords ***
Open Browser To Welcome Page
    Open Browser    ${HOME URL}    ${BROWSER}

Check If It Works
    Set Selenium Speed    ${DELAY}
    Page Should Contain    Sign in and start watching

感谢您的帮助!!

【问题讨论】:

    标签: selenium robotframework


    【解决方案1】:

    如果没有其他信息,我猜你的测试代码到达页面有点太早了。请尝试以下操作:

    Check If It Works
        Set Selenium Speed    ${DELAY}
        Wait Until Page Contains    Sign in and start watching 
        Page Should Contain    Sign in and start watching
    

    查看this list了解更多信息。

    【讨论】:

      猜你喜欢
      • 2015-09-28
      • 2016-04-28
      • 2017-12-23
      • 2021-06-10
      • 2015-12-24
      • 2016-08-17
      • 2017-08-22
      • 2012-03-26
      • 2020-02-07
      相关资源
      最近更新 更多