Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *** Settings ***
- Library OperatingSystem
- Library Selenium2Library
- Library String
- Test setup Setup
- Test Teardown Teardown
- *** Variables ***
- *** Keywords ***
- Setup
- Set Environment Variable webdriver.chrome.driver /usr/local/bin/chromedriver
- Open Browser http://localhost:8080/hotel/faces/login/login.xhtml browser=chrome
- Maximize Browser Window
- Set Selenium Speed .2
- Set Selenium Timeout 20
- Delete all cookies
- Teardown
- Click element //*[@id="side-menu"]/li[5]/a
- Click element //*[@id="j_idt49"]/table/tbody/tr[6]/td[7]/a[3]
- Close all Browsers
- *** Test Cases ***
- Testcase2
- #generate random numbers
- ${client_name} = Generate Random String 10 LETTERS]
- ${client_email}= Catenate SEPARATOR= ${client_name} @email.com
- ${client_ssn}= Generate Random String 7 [NUMBERS]
- #login
- Wait Until Page Contains Login
- Input Text id=formLogin:login marc
- Input Text id=formLogin:senha 1010
- Click Element name=formLogin:j_idt27
- Wait Until Page Contains Dashboard
- #create a new client
- Click Element xpath=//*[@id="side-menu"]/li[5]/a #click user in the sidebar
- Wait Until Page Contains List
- Click ELement xpath=//*[@id="j_idt49"]/a[1] # click create new user
- Wait Until Page Contains Create New Client
- Input Text id=name ${client_name}
- Input Text id=email ${client_email}
- Select Checkbox id=gender:0
- Input Text id=socialSecurityNumber ${client_ssn}
- Click Element //*[@id="j_idt51"]/a[1] #click save
- Wait Until Page Contains Client was successfully created.
- Click Element xpath=//*[@id="j_idt50"]/a[4] #click show all users
- Wait Until Page Contains List
- Page Should Contain ${client_name}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement