本文整理汇总了Python中reportlog.Log.Log.logError方法的典型用法代码示例。如果您正苦于以下问题:Python Log.logError方法的具体用法?Python Log.logError怎么用?Python Log.logError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlog.Log.Log
的用法示例。
在下文中一共展示了Log.logError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getLocationForElementXpath
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getLocationForElementXpath(self, xPath):
if AbstractPage.flag:
try:
element = self.getElementByXPath(xPath)
return element.location['x'], element.location['y']
except Exception, e:
Log.logError(str(e))
示例2: selectDropdownListItem
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def selectDropdownListItem(self, id, value):
if AbstractPage.flag:
try:
select = Select(self.getElementByID(id))
select.select_by_visible_text(value)
except Exception, e:
Log.logError(str(e))
示例3: getLocationForElementById
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getLocationForElementById(self, id):
if AbstractPage.flag:
try:
element = self.getElementByID(id)
return element.location['x'], element.location['y']
except Exception, e:
Log.logError(str(e))
示例4: getNameOfPicture
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getNameOfPicture(self):
if AbstractPage.flag:
try:
return self.getAttributeByXPath(self.img_myProfile_xpath, "title")
except Exception, e:
Log.logError(str(e))
示例5: selectDropdownListItemXpath
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def selectDropdownListItemXpath(self, xpath, xpathItem):
if AbstractPage.flag:
try:
self.getSettingPage.getElementByXPath(xpath).click()
self.getSettingPage.getElementByXPath(xpathItem).click()
except Exception, e:
Log.logError(str(e))
示例6: clickElementById
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def clickElementById(self, id):
if AbstractPage.flag:
try:
element = self.getElementByID(id)
element.click()
except Exception, e:
Log.logError(str(e))
示例7: clickElementByXPath
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def clickElementByXPath(self, xpath):
if AbstractPage.flag:
try:
element = self.getElementByXPath(xpath)
element.click()
except Exception, e:
Log.logError(str(e))
示例8: sendKeyByxPath
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def sendKeyByxPath(self, xPath, value):
if AbstractPage.flag:
try:
element = self.getElementByXPath(xPath)
element.clear()
element.send_keys(value)
except Exception, e:
Log.logError(str(e))
示例9: sendKeyById
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def sendKeyById(self, id, value):
if AbstractPage.flag:
try:
element = self.getElementByID(id)
element.clear()
element.send_keys(value)
except Exception, e:
Log.logError(str(e))
示例10: getTextById
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getTextById(self, id):
if AbstractPage.flag:
try:
element = self.getElementByID(id)
return element.text
except Exception, e:
Log.logError(str(e))
AbstractPage.flag = False
示例11: getTextByXPath
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getTextByXPath(self, xpath):
if AbstractPage.flag:
try:
element = self.getElementByXPath(xpath)
return element.text
except Exception, e:
Log.logError(str(e))
AbstractPage.flag = False
示例12: getAttributeById
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getAttributeById(self, id, attributeName):
if AbstractPage.flag:
try:
element = self.getElementByID(id)
return element.get_attribute(attributeName)
except Exception, e:
Log.logError(str(e))
AbstractPage.flag = False
示例13: closeBrowser
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def closeBrowser():
try:
AbstractPage.Browser().quit()
AbstractPage.browser = None
AbstractPage.flag = True
Log.logInfo("Close browser")
except Exception, e:
Log.logError(str(e))
示例14: mouseMoveToElementById
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def mouseMoveToElementById(self, elementID):
if AbstractPage.flag:
try:
element = self.getElementByID(elementID)
hov = ActionChains(AbstractPage.Browser()).move_to_element(element)
hov.perform()
except Exception, e:
Log.logError(str(e))
示例15: getElementByXPath
# 需要导入模块: from reportlog.Log import Log [as 别名]
# 或者: from reportlog.Log.Log import logError [as 别名]
def getElementByXPath(self, xPath, timeout = 30):
if AbstractPage.flag:
try:
WebDriverWait(AbstractPage.Browser, timeout).until(lambda driver: AbstractPage.Browser().find_element_by_xpath(xPath))
return AbstractPage.Browser().find_element_by_xpath(xPath)
except Exception, e:
Log.logError(str(e))
AbstractPage.flag = False