UIAutoDemo/models/osDriver.py

31 lines
987 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import platform
from seldom.logging import log
"""
# 判断当前操作系统环境;以此来自动选择不同浏览器环境的驱动
"""
def osSystem(path=''):
os_system = platform.system()
if os_system == 'Windows':
log.info('当前操作系统Windows')
pathWin = path + r'Browser_Driver/chromedriver84(win32).exe'
return pathWin
elif os_system == 'Darwin' or \
os_system == 'darwin' or \
os_system == 'Mac' or \
os_system == 'mac' or \
os_system == 'OS X':
log.info('当前操作系统Mac OS')
pathMac = path + r'Browser_Driver/chromedriver84(Mac64)'
return pathMac
else:
log.error("当前操作系统 " + os_system)
raise SystemExit(log.error(' ❌ The current operating system environment is not Windows or Mac, '
'please confirm the current environment!!'))
if __name__ == '__main__':
osSystem()