When is created the report emailable-report.html?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

When is created the report emailable-report.html?

Anda Spa
Hello,

I faced the issue:

I want to send the emailable-report.html through email, but I got : D:\test-output\emailable-report.html (The system cannot find the file specified)

I tried different events to send the report:

    @Override
    public void onFinish(ISuite suite) {
        System.out.println("Finish suite: " + suite.getName());

        try {
            Thread.sleep(3000);
            SendEmailAtachament.SendEmail("email2", "email1", "Report", "D:\\test-output\\emailable-report.html");
            System.out.println("");
        } catch (Exception ex) {
            System.out.println("");
            System.out.println(ex.getMessage());
            //ex.printStackTrace();
        }

but the report is not created.

At this event if I not delete the folder D:\\test-output\ I send me the old report.



    @Override
    public void onTestFailure(ITestResult tr) {


        try {
            SendEmailAtachament.SendEmail("email2", "email1", "Test Cases Failed", "D:\\test-output\\emailable-report.html");
    
        } catch (Exception ex) {
     
            System.out.println(ex.getMessage());
            //ex.printStackTrace();
        }
    }

The same error.

Can someone give me a hint?









--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: When is created the report emailable-report.html?

Krishnan Mahadevan

I have replied to the bug that you raised: https://github.com/cbeust/testng/issues/1708

 

Short answer: TestNG is working as designed. onFinish(ISuite suite) is still part of the suite execution. TestNG will start report generation only after all the suites have run to completion. You should look to leverage IExecutionListener instead.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Reply-To: <[hidden email]>
Date: Wednesday, February 28, 2018 at 6:04 PM
To: testng-users <[hidden email]>
Subject: [testng-users] When is created the report emailable-report.html?

 

Hello,

 

I faced the issue:

 

I want to send the emailable-report.html through email, but I got : D:\test-output\emailable-report.html (The system cannot find the file specified)

 

I tried different events to send the report:

 

    @Override

    public void onFinish(ISuite suite) {

        System.out.println("Finish suite: " + suite.getName());

 

        try {

            Thread.sleep(3000);

            SendEmailAtachament.SendEmail("email2", "email1", "Report", "D:\\test-output\\emailable-report.html");

            System.out.println("");

        } catch (Exception ex) {

            System.out.println("");

            System.out.println(ex.getMessage());

            //ex.printStackTrace();

        }

 

but the report is not created.

 

At this event if I not delete the folder D:\\test-output\ I send me the old report.

 

 

 

    @Override

    public void onTestFailure(ITestResult tr) {

 

 

        try {

            SendEmailAtachament.SendEmail("email2", "email1", "Test Cases Failed", "D:\\test-output\\emailable-report.html");

    

        } catch (Exception ex) {

     

            System.out.println(ex.getMessage());

            //ex.printStackTrace();

        }

    }

 

The same error.

 

Can someone give me a hint?

 

 

 

 

 

 

 

 

 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To post to this group, send email to
[hidden email].
Visit this group at
https://groups.google.com/group/testng-users.
For more options, visit
https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: When is created the report emailable-report.html?

Anda Spa

Thanks for your reponse.

Thats cool.




On Thursday, 1 March 2018 04:45:54 UTC+2, Krishnan Mahadevan wrote:

I have replied to the bug that you raised: <a href="https://github.com/cbeust/testng/issues/1708" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues%2F1708\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFrSlUcLuz7JNFWfSgk2uyDsR6Axw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues%2F1708\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFrSlUcLuz7JNFWfSgk2uyDsR6Axw&#39;;return true;">https://github.com/cbeust/testng/issues/1708

 

Short answer: TestNG is working as designed. onFinish(ISuite suite) is still part of the suite execution. TestNG will start report generation only after all the suites have run to completion. You should look to leverage IExecutionListener instead.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/

My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XxwCKZJrAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Date: Wednesday, February 28, 2018 at 6:04 PM
To: testng-users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XxwCKZJrAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Subject: [testng-users] When is created the report emailable-report.html?

 

Hello,

 

I faced the issue:

 

I want to send the emailable-report.html through email, but I got : D:\test-output\emailable-report.html (The system cannot find the file specified)

 

I tried different events to send the report:

 

    @Override

    public void onFinish(ISuite suite) {

        System.out.println("Finish suite: " + suite.getName());

 

        try {

            Thread.sleep(3000);

            SendEmailAtachament.SendEmail("email2", "email1", "Report", "D:\\test-output\\emailable-report.html");

            System.out.println("");

        } catch (Exception ex) {

            System.out.println("");

            System.out.println(ex.getMessage());

            //ex.printStackTrace();

        }

 

but the report is not created.

 

At this event if I not delete the folder D:\\test-output\ I send me the old report.

 

 

 

    @Override

    public void onTestFailure(ITestResult tr) {

 

 

        try {

            SendEmailAtachament.SendEmail("email2", "email1", "Test Cases Failed", "D:\\test-output\\emailable-report.html");

    

        } catch (Exception ex) {

     

            System.out.println(ex.getMessage());

            //ex.printStackTrace();

        }

    }

 

The same error.

 

Can someone give me a hint?

 

 

 

 

 

 

 

 

 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XxwCKZJrAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XxwCKZJrAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users@....
Visit this group at
<a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;">https://groups.google.com/group/testng-users.
For more options, visit
<a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: When is created the report emailable-report.html?

Anda Spa
The report emailable-report.html is not rewrite when you send the report on 


    @AfterSuite(alwaysRun = true)
    public void afterSuite() throws Exception {
          try {
            System.out.println("");
            SendEmailAtachament.SendEmail("email2", "email1", "Raport Teste Automate", "D:\\test-output\\emailable-report.html");
            System.out.println("end email Raport Teste Automate");
        } catch (Exception ex) {
        
            System.out.println(ex.getMessage());
            //ex.printStackTrace();
        }
    }


Must I delete the report before next execution of test cases?

At first execution the report is send correctly, but at the next execution is send the prevoius report.

I run my test cases programatically:



        TestListenerAdapter tla = new TestListenerAdapter();
            TestNG testng = new TestNG();
            testng.setOutputDirectory("D:\\test-output");

            List<String> suites = Lists.newArrayList();
            suites.add(args[0]);//path to xml..
            // suites.add("c:/tests/testng2.xml");
            testng.setTestSuites(suites);
            testng.run();


Thanks again,




On Thursday, 1 March 2018 12:08:48 UTC+2, [hidden email] wrote:

Thanks for your reponse.

Thats cool.




On Thursday, 1 March 2018 04:45:54 UTC+2, Krishnan Mahadevan wrote:

I have replied to the bug that you raised: <a href="https://github.com/cbeust/testng/issues/1708" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues%2F1708\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFrSlUcLuz7JNFWfSgk2uyDsR6Axw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues%2F1708\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFrSlUcLuz7JNFWfSgk2uyDsR6Axw&#39;;return true;">https://github.com/cbeust/testng/issues/1708

 

Short answer: TestNG is working as designed. onFinish(ISuite suite) is still part of the suite execution. TestNG will start report generation only after all the suites have run to completion. You should look to leverage IExecutionListener instead.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/

My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

Reply-To: <[hidden email]>
Date: Wednesday, February 28, 2018 at 6:04 PM
To: testng-users <[hidden email]>
Subject: [testng-users] When is created the report emailable-report.html?

 

Hello,

 

I faced the issue:

 

I want to send the emailable-report.html through email, but I got : D:\test-output\emailable-report.html (The system cannot find the file specified)

 

I tried different events to send the report:

 

    @Override

    public void onFinish(ISuite suite) {

        System.out.println("Finish suite: " + suite.getName());

 

        try {

            Thread.sleep(3000);

            SendEmailAtachament.SendEmail("email2", "email1", "Report", "D:\\test-output\\emailable-report.html");

            System.out.println("");

        } catch (Exception ex) {

            System.out.println("");

            System.out.println(ex.getMessage());

            //ex.printStackTrace();

        }

 

but the report is not created.

 

At this event if I not delete the folder D:\\test-output\ I send me the old report.

 

 

 

    @Override

    public void onTestFailure(ITestResult tr) {

 

 

        try {

            SendEmailAtachament.SendEmail("email2", "email1", "Test Cases Failed", "D:\\test-output\\emailable-report.html");

    

        } catch (Exception ex) {

     

            System.out.println(ex.getMessage());

            //ex.printStackTrace();

        }

    }

 

The same error.

 

Can someone give me a hint?

 

 

 

 

 

 

 

 

 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to
[hidden email].
Visit this group at
<a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;">https://groups.google.com/group/testng-users.
For more options, visit
<a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.