aboutsummaryrefslogtreecommitdiff
path: root/webtests/browser_run.py
diff options
context:
space:
mode:
authorZachary Sloan2013-08-22 16:54:13 -0500
committerZachary Sloan2013-08-22 16:54:13 -0500
commitb34e262f0371952fdec850483c0929d4f0a858d1 (patch)
tree6c1d04ddc6d92999b86e4ad3374f98ad222bd95f /webtests/browser_run.py
parent2db8468a8e3e802588d97bdeb64b5b638d634bb6 (diff)
downloadgenenetwork2-b34e262f0371952fdec850483c0929d4f0a858d1.tar.gz
Fixed import in show_trait_js_test.py
Added a function to browser_run.py that gets an element's style
Diffstat (limited to 'webtests/browser_run.py')
-rw-r--r--webtests/browser_run.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/webtests/browser_run.py b/webtests/browser_run.py
index b2058cf8..2ec299c5 100644
--- a/webtests/browser_run.py
+++ b/webtests/browser_run.py
@@ -13,7 +13,8 @@ from selenium.webdriver.common.keys import Keys
class Test(object):
def __init__(self):
- self.browser = webdriver.Chrome('/home/gn2/gn2/webtests/chromedriver')
+ #self.browser = webdriver.Chrome('/home/gn2/gn2/webtests/chromedriver')
+ self.browser = webdriver.Firefox()
def get(self, url):
self.browser.get(url)
@@ -52,6 +53,11 @@ class Test(object):
el = self.browser.find_element_by_xpath(xpath_selector)
text = el.text.strip() or el.get_attribute("value").strip()
print("text:", text)
+
+ def get_element_style(self, xpath_selector):
+ el = self.browser.find_element_by_xpath(xpath_selector)
+ style = el.get_attribute("style").strip()
+ print("style:", style)
def switch_window(self):
self.browser.switch_to_window(self.browser.window_handles[-1])