tadasajon
tadasajon

Reputation: 14866

Selenium unit tests in Python -- where is my log file?

So I exported some unit tests from the Selenium IDE to Python. Now I'm trying to debug something, and I've noticed that Selenium uses the logging module. There is one particular line in selenium.webdriver.remote.remote_connection that I would really like to see the output of. It is:

LOGGER.debug('%s %s %s' % (method, url, data))

At the top of the file is another line that reads:

LOGGER = logging.getLogger(__name__)

So where is this log file? I want to look at it.

Upvotes: 2

Views: 4079

Answers (1)

unutbu
unutbu

Reputation: 880359

In your unit test script, place

import logging
logging.basicConfig(filename = log_filename, level = logging.DEBUG)

where log_filename is a path to wherever you'd like the log file written to.

Without the call to logging.basicConfig or some such call to setup a logging handler, the LOGGER.debug command does nothing.

Upvotes: 3

Related Questions