繁体   English   中英

具有Selenium2Library的机器人框架-语法是否错误?

[英]Robot framework with Selenium2Library - Is the syntax wrong?

我刚开始使用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

谢谢您的帮助!!

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

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

检查此列表以获取更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM