-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_page.py
More file actions
31 lines (23 loc) · 741 Bytes
/
base_page.py
File metadata and controls
31 lines (23 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from selenium.common.exceptions import WebDriverException
class Page(object):
"""
Base Class For all Pages
"""
def __init__(self, testsetup):
self.testsetup = testsetup
self.driver = testsetup['driver']
self.timeout = testsetup['timeout']
self.driver.implicitly_wait(testsetup['timeout'])
#self.driver.get(testsetup['goto'])
def maximize_window(self):
try:
self.driver.maximize_window()
except WebDriverException:
pass
def goto(self, url):
driver = self.driver
driver.get(url)
def go_back(self):
self.driver.back()
def refresh(self):
self.driver.refresh()