带Selenium2库的Robot框架-语法错误吗?

带Selenium2库的Robot框架-语法错误吗?,selenium,robotframework,Selenium,Robotframework,我刚开始使用Robot框架,我编写了一些简单的测试,应该通过,但没有通过。截图清楚地显示了网站上的元素。以下是几个例子: Page Should Contain Element name websiteRegistration 或 查找文本 整个resource.txt描述如下: *** Settings *** Documentation A resource file with reusable keywords and variables. ... ...

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

Page Should Contain Element    name    websiteRegistration

查找文本

整个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

谢谢你的帮助

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

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
查看更多信息

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