Search code examples
python-2.7seleniumselenium-webdrivernose

Python nosetests no such option --html--report how to generate the html report


I have a Selenium Python regression test script. My HTMLTestRunner is not working to generate the test report. I am now trying to use the Nose plugin to generate a HTML report.

I have installed Nose and pip install nose-html-reporting

I am trying the following command in windows cmd to run my test script and generate the report.

nosetests.exe e:\test_runners\selenium_regression_test\ClearCore\Regression TestCase\RegressionProject_TestCase2.py --with-html --html-report=nose_report.html

I get the following error:

nosestests: error: no such option: --html-report

Could someone show me an example command I could use to run my test script and output the html report?

I have got it to work now. I have used the following command

nosetests.exe e:\test_runners\selenium_regression_test\ClearCore\Regression TestCase\RegressionProject_TestCase2.py --with-html --html-file=e:\report.html

Is there a way I can add this command to my test script e.g. In the Main part? So i can run it through the PyCharm IDE? I would also like to add a date to the report file name. When the tests run overnight it would be good to have a date in the file name. How can i do this please?

if __name__ == '__main__':

Thanks, Riaz


Solution

  • It seems the nose-html-reporting plugin is not installed yet.

    pip install nose-html-reporting
    

    Below command prints the list of installed plugins to check.

    nosetests --plugins