Url弹出机器人框架

时间:2017-03-08 17:17:41

标签: python popup robotframework

我需要验证机器人框架上的URL弹出 我可以使用哪种方法机器人 我使用位置应该是那样的方法

Click element ${button}
Location Should Be  URL
Close All Browsers

但它不起作用 请帮忙

1 个答案:

答案 0 :(得分:0)

以下是变量Location的例子。这是我的样本。

我的amazon.robot看起来像:

*** Settings ***         
Resource          resource.robot

*** Test Cases ***
Open Amazon & Careers
Open Browser To Amazon
Amazon Page Should Be Open
Go To Careers Page
[Teardown]    Close Browser

我的resource.robot看起来像:

*** Keywords ***
Open Browser To Amazon
Open Browser    ${URL}    ${BROWSER}
Maximize Browser Window
Set Selenium Speed    ${DELAY}

Amazon Page Should Be Open
Title Should Be    Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more

Go To Careers Page
Wait Until Page Contains        Careers
Click Element   link=Careers
Location Should Be      https://www.amazon.jobs/

Selenium2Library说:“验证当前网址是否正确。” http://robotframework.org/Selenium2Library/Selenium2Library.html