caseyprogramming
caseyprogramming

Reputation: 62

Setting up Klov with Extent Reports

I am trying to set up Klov for the first time with a new project. I have installed the correct version of mongodb and have the klov jar. I run both in the cmd prior to running my test. When I go to view my Klov report in the browser everything appears to be working correctly except for the fact that there are no projects listed in the "select your project:" drop down. Does anybody know why I may be having this error?

public class MyRunner {

private static KlovReporter klov;
private static ExtentReports extent;
private static Date d;
private static ExtentHtmlReporter htmlReporter;

@BeforeClass
public static void initialize(){
    d = new Date();
    extent = new ExtentReports();
    klov = new KlovReporter();
    htmlReporter = new ExtentHtmlReporter("ExtentReport.html");

    htmlReporter.setAppendExisting(true);
    htmlReporter.config().setChartVisibilityOnOpen(true);
    htmlReporter.config().setDocumentTitle("Klov Example");
    htmlReporter.config().setReportName("Test");
    htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
    htmlReporter.config().setTheme(Theme.STANDARD);

    klov.initMongoDbConnection("localhost",27017);
    klov.setProjectName("klovexample");
    klov.setReportName("Test" + d.toString());
    klov.setKlovUrl("http://localhost:80");

    extent.attachReporter(htmlReporter, klov);

    extent.createTest("ROF");
}

@AfterClass
public static void teardown(){
    klov.flush();
}

Upvotes: 0

Views: 2313

Answers (1)

Karthik
Karthik

Reputation: 477

Use

extent.flush();

Instead of

klov.flush();

Also add a log guy:

extent.createTest("ROF").pass("log");

Upvotes: 0

Related Questions