Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps |
| 3 | Library Collections |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 4 | Library OperatingSystem |
| 5 | Library ExtendedSelenium2Library |
| 6 | Resource global_properties.robot |
| 7 | |
| 8 | *** Variables *** |
| 9 | |
| 10 | *** Keywords *** |
| 11 | Setup 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} |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 16 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 17 | Setup Browser Firefox |
| 18 | ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 19 | Set To Dictionary ${dc} elementScrollBehavior 1 |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 20 | Create Webdriver Firefox desired_capabilities=${dc} |
| 21 | Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc} |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 22 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 23 | Setup Browser Chrome |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 24 | ${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 |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 28 | Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc} |
| 29 | Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 30 | |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 31 | Handle Proxy Warning |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 32 | [Documentation] Handle Intermediate Warnings from Proxies |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 33 | ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 34 | Return From Keyword if '${status}' != 'PASS' |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 35 | ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 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}" == '' |
kaihlavi | 5fe4afa | 2019-08-12 15:55:52 +0300 | [diff] [blame] | 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} |