-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_driver.py
More file actions
23 lines (19 loc) · 756 Bytes
/
base_driver.py
File metadata and controls
23 lines (19 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from appium import webdriver
from appium.options.common import AppiumOptions
class BaseDriver:
def __init__(self):
self.driver = None
def get_driver(self):
options = AppiumOptions()
options.platform_name = 'Android'
options.automation_name = 'UiAutomator2'
options.device_name = 'emulator-5554'
options.noReset = True
options.platform_version = '15'
options.appPackage = 'blibli.mobile.commerce'
options.appActivity = 'blibli.mobile.ng.commerce.core.home_page.view.HomePageActivity'
self.driver = webdriver.Remote('http://localhost:4723', options=options)
return self.driver
def stop_driver(self):
if self.driver:
self.driver.quit()