blob: e98c501a4c40926602458e90b728fb4bfe66705f [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}
kaihlavi5fe4afa2019-08-12 15:55:52 +030016
Gary Wu9abb61c2018-09-27 10:38:50 -070017Setup Browser Firefox
18 ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver
kaihlavi5fe4afa2019-08-12 15:55:52 +030019 Set To Dictionary ${dc} elementScrollBehavior 1
Gary Wu9abb61c2018-09-27 10:38:50 -070020 Create Webdriver Firefox desired_capabilities=${dc}
21 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
kaihlavi5fe4afa2019-08-12 15:55:52 +030022
Gary Wu9abb61c2018-09-27 10:38:50 -070023 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
kaihlavi5fe4afa2019-08-12 15:55:52 +030028 Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc}
29 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
Gary Wu9abb61c2018-09-27 10:38:50 -070030
kaihlavi5fe4afa2019-08-12 15:55:52 +030031Handle Proxy Warning
Gary Wu9abb61c2018-09-27 10:38:50 -070032 [Documentation] Handle Intermediate Warnings from Proxies
kaihlavi5fe4afa2019-08-12 15:55:52 +030033 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE}
Gary Wu9abb61c2018-09-27 10:38:50 -070034 Return From Keyword if '${status}' != 'PASS'
kaihlavi5fe4afa2019-08-12 15:55:52 +030035 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
Gary Wu9abb61c2018-09-27 10:38:50 -070036 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}" == ''
kaihlavi5fe4afa2019-08-12 15:55:52 +030039 ${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}