blob: 7d2cea798d053a119a5761b4a32603396031c1f7 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** 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
DR695Hccff30b2017-02-17 18:44:24 -05004Library OperatingSystem
DR695H910097e2019-05-08 13:55:32 -04005Library SeleniumLibrary
DR695Hccff30b2017-02-17 18:44:24 -05006Resource global_properties.robot
7
8*** Variables ***
Jerry Flood71b7b0f2017-10-02 16:25:06 -04009${HEADLESS} True
DR695Hccff30b2017-02-17 18:44:24 -050010
11*** Keywords ***
12Setup Browser
13 [Documentation] Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER}
14 Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'firefox' Setup Browser Firefox
15 Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'chrome' Setup Browser Chrome
16 Log Running with ${GLOBAL_SELENIUM_BROWSER}
Jerry Flood71b7b0f2017-10-02 16:25:06 -040017
DR695Hccff30b2017-02-17 18:44:24 -050018Setup Browser Firefox
Jerry Flood71b7b0f2017-10-02 16:25:06 -040019 ${caps}= Evaluate sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX sys
20 Set To Dictionary ${caps} marionette=
21 Set To Dictionary ${caps} elementScrollBehavior 1
Jerry Flood71b7b0f2017-10-02 16:25:06 -040022 ${wd}= Create WebDriver Firefox capabilities=${caps}
23 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${caps}
24
Brian Freeman3d2a0bc2020-04-11 07:28:38 -050025
DR695H67afaca2019-07-23 17:13:23 -040026Setup Browser Chrome
DR695Hccff30b2017-02-17 18:44:24 -050027 ${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys
28 Call Method ${chrome options} add_argument no-sandbox
Brian Freeman3d2a0bc2020-04-11 07:28:38 -050029 Call Method ${chrome options} add_argument ignore-certificate-errors
Jerry Flood71b7b0f2017-10-02 16:25:06 -040030 Run Keyword If ${HEADLESS}==True Call Method ${chrome options} add_argument headless
DR695Hccff30b2017-02-17 18:44:24 -050031 ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver
32 Set To Dictionary ${dc} elementScrollBehavior 1
Brian Freeman3d2a0bc2020-04-11 07:28:38 -050033 Set To Dictionary ${dc} ACCEPT_SSL_CERTS True
Jerry Flood71b7b0f2017-10-02 16:25:06 -040034 Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc}
35 Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc}
DR695Hccff30b2017-02-17 18:44:24 -050036
Brian Freeman3d2a0bc2020-04-11 07:28:38 -050037
38
39
Jerry Flood71b7b0f2017-10-02 16:25:06 -040040Handle Proxy Warning
DR695Hccff30b2017-02-17 18:44:24 -050041 [Documentation] Handle Intermediate Warnings from Proxies
DR695H910097e2019-05-08 13:55:32 -040042 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist ${GLOBAL_PROXY_WARNING_TITLE}
DR695Hccff30b2017-02-17 18:44:24 -050043 Return From Keyword if '${status}' != 'PASS'
DR695H910097e2019-05-08 13:55:32 -040044 ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist ${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
DR695Hccff30b2017-02-17 18:44:24 -050045 Return From Keyword if '${status}' != 'PASS'
46 Return From Keyword if "${GLOBAL_PROXY_WARNING_TITLE}" == ''
47 Return From Keyword if "${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}" == ''
48 ${test} ${value}= Run keyword and ignore error Title Should Be ${GLOBAL_PROXY_WARNING_TITLE}
Brian Freeman3d2a0bc2020-04-11 07:28:38 -050049 Run keyword If '${test}' == 'PASS' Click Element xpath=${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}