def getTestRunError(connection, sessionUrl):
    """
    This method gets the error that appeared during the last test run.
    If no error appeared (the test ran successfully),
    the return value will be 'None'.
    """

    activeTestUrl = '%s/ixload/test/activeTest' % sessionUrl
    testObj = connection.httpGet(activeTestUrl)

    return testObj.testRunError