Commit 75a6eb3d by linguangwei

判断当前系统是否为Windows或者darwin(mac)(当前只有两钟系统)

parent 72a0ae42
import os
import platform
from time import sleep, time
from src.framework.common import file_abspath
......@@ -9,7 +10,11 @@ from selenium.webdriver.chrome.webdriver import WebDriver
# web_driver_path = os.path.join(
# "./chromedriver")
service = webdriver.chrome.service.Service(file_abspath() + "/tools/chromedriver.exe")
if platform.system().lower() == "windows":
service = webdriver.chrome.service.Service(file_abspath() + "/tools/chromedriver.exe")
elif platform.system().lower() == "darwin":
service = webdriver.chrome.service.Service(file_abspath() + "/tools/chromedriver")
service.start()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment