java.lang. Ошибка: нерешенная проблема компиляции ChartLocation не может быть решена для переменной - PullRequest
0 голосов
/ 31 октября 2019

Новое в автоматизации тестирования.

Я пытаюсь запустить Testcase, используя TestNG с eclipse, и обнаружил эту ошибку:

[java.lang.Error: Неразрешенная проблема компиляции:ChartLocation не может быть преобразован в переменную ....]

Спасибо за вашу поддержку.

КОД НИЖЕ:

public class Reporting extends TestListenerAdapter
{

public ExtentHtmlReporter htmlReporter;
public ExtentReports extent;
public ExtentTest logger;


public void onStart(ITestContext testContext)
{
    String timeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());//time stamp
    String repName="Test-Report-"+timeStamp+".html";

    htmlReporter=new ExtentHtmlReporter(System.getProperty("user.dir")+ "/test-output/"+repName);//specify location of the report
    htmlReporter.loadXMLConfig(System.getProperty("user.dir")+ "/extent-config.xml");

    extent=new ExtentReports();

    extent.attachReporter(htmlReporter);
    extent.setSystemInfo("Host name","localhost");
    extent.setSystemInfo("Environemnt","QA");
    extent.setSystemInfo("user","pavan");

    htmlReporter.config().setDocumentTitle("InetBanking Test Project"); // Tile of report
    htmlReporter.config().setReportName("Functional Test Automation Report"); // name of the report

    htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP); //location of the chart
    htmlReporter.config().setTheme(Theme.DARK);
}

public void onTestSuccess(ITestResult tr)
{
    logger=extent.createTest(tr.getName()); // create new entry in th report
    logger.log(Status.PASS,MarkupHelper.createLabel(tr.getName(),ExtentColor.GREEN)); // send the passed information to the report with GREEN color highlighted
}

public void onTestFailure(ITestResult tr)
{
    logger=extent.createTest(tr.getName()); // create new entry in th report
    logger.log(Status.FAIL,MarkupHelper.createLabel(tr.getName(),ExtentColor.RED)); // send the passed information to the report with GREEN color highlighted

    String screenshotPath=System.getProperty("user.dir")+"\\Screenshots\\"+tr.getName()+".png";

    File f = new File(screenshotPath); 

    if(f.exists())
    {
    try {
        logger.fail("Screenshot is below:" + logger.addScreenCaptureFromPath(screenshotPath));
        } 
    catch (IOException e) 
            {
            e.printStackTrace();
            }
    }

}

public void onTestSkipped(ITestResult tr)
{
    logger=extent.createTest(tr.getName()); // create new entry in th report
    logger.log(Status.SKIP,MarkupHelper.createLabel(tr.getName(),ExtentColor.ORANGE));
}

public void onFinish(ITestContext testContext)
{
    extent.flush();
}
}
...