diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-12-08 21:31:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-12-08 21:31:21 +0000 |
commit | 6c89f17af8fa785b5e6ea79da019cb8c6f7a942a (patch) | |
tree | cf52da593baf77023dd483e3f66ecd0b6162fa6a /robot/resources/browser_setup.robot | |
parent | 9cfbec8eff01743b66acc75f869a7e3fd44a7df8 (diff) | |
parent | 71b7b0f6c0d54e72ca1f59e8d2f90405d5cba244 (diff) |
Merge "Configure to run Robot w/chrome headless option dd"
Diffstat (limited to 'robot/resources/browser_setup.robot')
-rw-r--r-- | robot/resources/browser_setup.robot | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/robot/resources/browser_setup.robot b/robot/resources/browser_setup.robot index 6ef4f726..5d34d3de 100644 --- a/robot/resources/browser_setup.robot +++ b/robot/resources/browser_setup.robot @@ -7,6 +7,7 @@ Library ExtendedSelenium2Library Resource global_properties.robot *** Variables *** +${HEADLESS} True *** Keywords *** Setup Browser @@ -14,28 +15,33 @@ Setup Browser Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'firefox' Setup Browser Firefox Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'chrome' Setup Browser Chrome Log Running with ${GLOBAL_SELENIUM_BROWSER} - + + Setup Browser Firefox - ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver - Set To Dictionary ${dc} elementScrollBehavior 1 - Create Webdriver Firefox desired_capabilities=${dc} - Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc} - + ${caps}= Evaluate sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX sys + Set To Dictionary ${caps} marionette= + Set To Dictionary ${caps} elementScrollBehavior 1 + # TODO + # Figure out how to run FF headless without Xvfb + ${wd}= Create WebDriver Firefox capabilities=${caps} + Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${caps} + Setup Browser Chrome - ${os}= Get Normalized Os + ${os}= Get Normalized Os Log Normalized OS=${os} ${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys Call Method ${chrome options} add_argument no-sandbox + Run Keyword If ${HEADLESS}==True Call Method ${chrome options} add_argument headless ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver Set To Dictionary ${dc} elementScrollBehavior 1 - Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc} - Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc} + Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc} + Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc} -Handle Proxy Warning +Handle Proxy Warning [Documentation] Handle Intermediate Warnings from Proxies - ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE} + ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_TITLE} Return From Keyword if '${status}' != 'PASS' - ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH} + ${status} ${data}= Run Keyword And Ignore Error Variable Should Exist \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH} Return From Keyword if '${status}' != 'PASS' Return From Keyword if "${GLOBAL_PROXY_WARNING_TITLE}" == '' Return From Keyword if "${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}" == '' |