blob: dfa6ab68e11eb20cf71ecb043acd627c3a750845 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
2Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps
3Library Collections
Gary Wu9abb61c2018-09-27 10:38:50 -07004Library OperatingSystem
5Library ExtendedSelenium2Library
6Resource global_properties.robot
7
8*** Variables ***
9
10*** Keywords ***
11Setup Browser
12 [Documentation] Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER}
13 Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'firefox' Setup Browser Firefox
14 Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'chrome' Setup Browser Chrome
15 Log Running with ${GLOBAL_SELENIUM_BROWSER}
16
17Setup Browser Firefox
18 ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver
19 Set To Dictionary ${dc} elementScrollBehavior 1
20 Create Webdriver Firefox desired_capabilities=${dc}
21 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
22
23 Setup Browser Chrome
Gary Wu9abb61c2018-09-27 10:38:50 -070024 ${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
25 Call Method ${chrome options} add_argument no-sandbox
26 ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver
27 Set To Dictionary ${dc} elementScrollBehavior 1
28 Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc}
29 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
30
31Handle Proxy Warning
32 [Documentation] Handle Intermediate Warnings from Proxies
33 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE}
34 Return From Keyword if '${status}' != 'PASS'
35 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
36 Return From Keyword if '${status}' != 'PASS'
37 Return From Keyword if "${GLOBAL_PROXY_WARNING_TITLE}" == ''
38 Return From Keyword if "${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}" == ''
39 ${test} ${value}= Run keyword and ignore error Title Should Be ${GLOBAL_PROXY_WARNING_TITLE}
40 Run keyword If '${test}' == 'PASS' Click Element xpath=${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}