简体   繁体   中英

Url pop up on robot framework

I need to verify URL pop up on robot framework which method robot can i use i use the method Location Should Be like that

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

but it doesn't work Any help please

Here is example of with variable Location Should be. Here is my sample.

My amazon.robot looks like:

*** 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

My resource.robot looks like:

*** 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 says: "Verifies that current URL is exactly url." http://robotframework.org/Selenium2Library/Selenium2Library.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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