ExtentX with Selenium in C# throwing error

184 Views Asked by At

I have configured my selenium tests in C# to report logs using Extent Reports and wanted to try the ExtentX version using MongoDB. I have set up ExtentX and MongoDB and they are running but the test fails with the following error...

"ArgumentNullException was unhandled by user code, value cannot be null" at the following line in the teardown...

extent.EndTest(test);

I am specifying the mongo connection string via...

extent = new ExtentReports(reportPath, true); // create instance 
extent.X("mongodb://localhost:27017");

The test runs fine when not specifying the mongo connection. Any help is much appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

Figured it out. I needed to add AssignProject("") to the extent. Now it works and the ExtentX reports are populated. There is missing data but that's another issue.