コード例 #1
0
ファイル: Uimethod.py プロジェクト: xcma/selenium
 def Falsecreenshot(self, casename):
     """截图放到相应路径中"""
     if operation in ["chrome", "firfox", "ie"]:
         cname = casename + datetime.datetime.now().strftime("%Y%m%d.%H%M%S.%f")[:-3]
         # 截图创建路径
         FalseScreenshotPath = Misc.ABSpath() + readConfig(Config_path)["path"]["FalseScreenshot"]
         log.debug(u"读取截图路径:" + str(FalseScreenshotPath))
         Misc.mkdir(path=Misc.ABSpath() + "/Output/Screenshot", name="Fail")
         self.driver.get_screenshot_as_file(FalseScreenshotPath + "%s.png" % cname)
         log.debug(u"False截图成功")
     else:
         log.warning("未执行截图")
コード例 #2
0
ファイル: UiMethods.py プロジェクト: xcma/selenium
 def Falsecreenshot(cls, casename):
     """截图放到相应路径中"""
     if operation in ['chrome', 'firfox', 'ie']:
         cname = casename + datetime.datetime.now().strftime("%Y%m%d.%H%M%S.%f")[:-3]
         # 截图创建路径
         FalseScreenshotPath = Misc.ABSpath()+readConfig(Config_path)['path']['FalseScreenshot']
         log.debug(u'读取截图路径:' + str(FalseScreenshotPath))
         Misc.mkdir(path=Misc.ABSpath()+"/Output/Screenshot", name='Fail')
         cls.driver.get_screenshot_as_file(FalseScreenshotPath+"%s.png" % cname)
         log.debug(u'False截图成功')
     else:
         log.warning('未执行截图')