Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. *** Settings ***
  2. Library OperatingSystem
  3. Library Selenium2Library
  4. Library String
  5.  
  6. Test setup Setup
  7. Test Teardown Teardown
  8.  
  9. *** Variables ***
  10.  
  11.  
  12.  
  13. *** Keywords ***
  14.  
  15.  
  16. Setup
  17.  
  18. Set Environment Variable webdriver.chrome.driver /usr/local/bin/chromedriver
  19. Open Browser http://localhost:8080/hotel/faces/login/login.xhtml browser=chrome
  20. Maximize Browser Window
  21. Set Selenium Speed .2
  22. Set Selenium Timeout 20
  23.  
  24. Delete all cookies
  25.  
  26.  
  27.  
  28. Teardown
  29. Click element //*[@id="side-menu"]/li[5]/a
  30. Click element //*[@id="j_idt49"]/table/tbody/tr[6]/td[7]/a[3]
  31. Close all Browsers
  32.  
  33.  
  34.  
  35.  
  36. *** Test Cases ***
  37.  
  38. Testcase2
  39.  
  40. #generate random numbers
  41. ${client_name} = Generate Random String 10 LETTERS]
  42. ${client_email}= Catenate SEPARATOR= ${client_name} @email.com
  43. ${client_ssn}= Generate Random String 7 [NUMBERS]
  44.  
  45. #login
  46. Wait Until Page Contains Login
  47. Input Text id=formLogin:login marc
  48. Input Text id=formLogin:senha 1010
  49. Click Element name=formLogin:j_idt27
  50. Wait Until Page Contains Dashboard
  51.  
  52. #create a new client
  53. Click Element xpath=//*[@id="side-menu"]/li[5]/a #click user in the sidebar
  54. Wait Until Page Contains List
  55. Click ELement xpath=//*[@id="j_idt49"]/a[1] # click create new user
  56. Wait Until Page Contains Create New Client
  57. Input Text id=name ${client_name}
  58. Input Text id=email ${client_email}
  59. Select Checkbox id=gender:0
  60. Input Text id=socialSecurityNumber ${client_ssn}
  61. Click Element //*[@id="j_idt51"]/a[1] #click save
  62. Wait Until Page Contains Client was successfully created.
  63. Click Element xpath=//*[@id="j_idt50"]/a[4] #click show all users
  64. Wait Until Page Contains List
  65. Page Should Contain ${client_name}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement