當前位置: 首頁>>代碼示例>>Python>>正文


Python Log.logError方法代碼示例

本文整理匯總了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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:HomePageKlout.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:9,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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))
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py

示例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
開發者ID:lovingJune,項目名稱:Selenium,代碼行數:10,代碼來源:AbstractPage.py


注:本文中的reportlog.Log.Log.logError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。