2 Documentation Logins to VID
3 Library Selenium2Library
6 Library RequestsLibrary
8 Library OperatingSystem
11 ${GLOBAL_APPLICATION_ID} robot-ete
12 ${GLOBAL_SELENIUM_BROWSER} chrome
13 ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} Create Dictionary
14 ${GLOBAL_SELENIUM_DELAY} 0
15 ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} 5
16 ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 15
18 ${VID_ENDPOINT} http://localhost:8080
19 ${VID_LOGIN_URL} ${VID_ENDPOINT}${VID_ENV}/login.htm
20 ${VID_HEALTHCHECK_PATH} ${VID_ENV}/api/v2/users
21 ${VID_HOME_URL} ${VID_ENDPOINT}${VID_ENV}/welcome.htm
22 ${GLOBAL_VID_USERNAME} demo
23 ${GLOBAL_VID_PASSWORD} Kp8bJ4SXszM0WX
28 [Documentation] Logs in to VID GUI
29 # Setup Browser Now being managed by test case
31 Go To ${VID_LOGIN_URL}
32 #Maximize Browser Window
33 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
34 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
35 Log Logging in to ${VID_ENDPOINT}${VID_ENV}
38 Input Text xpath=//input[@id='loginId'] ${GLOBAL_VID_USERNAME}
39 Input Password xpath=//input[@id='password'] ${GLOBAL_VID_PASSWORD}
40 Click Button xpath=//input[@id='loginBtn']
41 Wait Until Page Contains Welcome to VID ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
42 Log Logged in to ${VID_ENDPOINT}${VID_ENV}
43 [Teardown] Close Browser
47 [Documentation] Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER}
48 Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'firefox' Setup Browser Firefox
49 Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'chrome' Setup Browser Chrome
50 Log Running with ${GLOBAL_SELENIUM_BROWSER}
53 ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver
54 Set To Dictionary ${dc} elementScrollBehavior 1
55 Create Webdriver Firefox desired_capabilities=${dc}
56 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
59 #${os}= Get Normalized Os
60 #Log Normalized OS=${os}
61 ${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
62 Call Method ${chrome options} add_argument no-sandbox
63 ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver
64 Set To Dictionary ${dc} elementScrollBehavior 1
65 Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc}
66 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
69 [Documentation] Handle Intermediate Warnings from Proxies
70 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE}
71 Return From Keyword if '${status}' != 'PASS'
72 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
73 Return From Keyword if '${status}' != 'PASS'
74 Return From Keyword if "${GLOBAL_PROXY_WARNING_TITLE}" == ''
75 Return From Keyword if "${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}" == ''
76 ${test} ${value}= Run keyword and ignore error Title Should Be ${GLOBAL_PROXY_WARNING_TITLE}
77 Run keyword If '${test}' == 'PASS' Click Element xpath=${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}