|
def insert_img(driver, filename):
func_path = os.path.dirname(__file__)
base_dir = os.path.dirname(func_path)
base_dir = str(base_dir)
base_dir = base_dir.replace('\\', '/')
base = base_dir.split('/Website')[0]
filepath = base + '/Website/test_report/screenshot/' + filename
driver.get_screenshot_as_file(filepath)
我要把文件路径前加u,就是 driver.get_screenshot_as_file(filepath)在filepath前加u,加了以后实现如下功能,不知道要怎么拼接
driver.get_screenshot_as_file(u"C:/yeyue/python/111.png")
|
|