尝试在python中运行机器人代码。
当运行以下代码时,在输出控制台上我得到'找不到处理程序“RobotFramework”' 如何从另一个模块登录/打印以控制引发AssertionError? 或者记录发送到记录器“RobotFramework”的所有日志
from ExtendedSelenium2Library import ExtendedSelenium2Library
from robot.api import logger
class firsttest():
def googleit(self):
self.use_url = 'https://google.ca'
self.use_browser = 'chrome'
s2l = ExtendedSelenium2Library()
s2l.open_browser(self.use_url, self.use_browser)
s2l.maximize_browser_window()
try:
s2l.page_should_contain('this text does not exist on page')
except:
logger.console('failed')
runit = firsttest()
runit.googleit()
获取以下控制台输出:
failed
No handlers could be found for logger "RobotFramework"