aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/browser_setup.robot
diff options
context:
space:
mode:
authorJerry Flood <jf9860@att.com>2017-10-02 16:25:06 -0400
committerJerry Flood <jf9860@att.com>2017-10-02 16:27:37 -0400
commit71b7b0f6c0d54e72ca1f59e8d2f90405d5cba244 (patch)
tree5e09d798ca40fbc1db8d79ad8815e2e27a73d40c /robot/resources/browser_setup.robot
parent362453d5480a89c6c5354fbe36577f41656ae862 (diff)
Configure to run Robot w/chrome headless option dd
Issue: TEST-58 Change-Id: I1f45477c3df947dc8812c9da55d856a9b29be65a Signed-off-by: Jerry Flood <jf9860@att.com>
Diffstat (limited to 'robot/resources/browser_setup.robot')
-rw-r--r--robot/resources/browser_setup.robot30
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}" == ''