How do I console output log from another module - raise AssertionError

443 views Asked by At

Trying to run robot code in python.

When running the following code, on the output console I get 'No handlers could be found for logger "RobotFramework"' How do I log/print to console the raise AssertionError from another module? Or log all logs sent to logger "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()

Get following console output:

failed
No handlers could be found for logger "RobotFramework"
0

There are 0 answers