Report test

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

Report test

kaelog
First of all sory for my English, I'm French.

Selenium's great and useful, but i did not found a to log what append. Not
the log like in the selenium-ide, but a xml trace or something like that,
which can produce a html, pdf... report.

Hope I'm clear

--
@+
         Kaelog
Reply | Threaded
Open this post in threaded view
|

Re: Report test

Mathieu Vanderwhale
Hi Kaelog,

Just take a look at http://www.openqa.org/selenium/testrunner.html. In
the Continuous Integration section, you will find what you are looking
for...

Enjoy,

Le Feb 7, 2006, à 10:00 AM, kaelog a écrit :

> First of all sory for my English, I'm French.
>
> Selenium's great and useful, but i did not found a to log what append.
> Not
> the log like in the selenium-ide, but a xml trace or something like
> that,
> which can produce a html, pdf... report.
>
> Hope I'm clear
>
> --
> @+
>          Kaelog

Mathieu Vanderwhale, Analyst-Developer
 
Denali s.a., "Bridging the gap between Business and IT"
Château de Clerlande, B-1340 Ottignies, Belgium
Office: +32 10 43 99 51 Mob: +32 497 32 27 13 Fax: +32 10 43 99 52
Web: www.denali.be Email: [hidden email]
 
Legal notice: this message and its attachments may contain confidential
and/or privileged information. If you are not the addressee or
authorized to receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any information
herein. If you have received this message by mistake, please advise the
sender immediately by return e-mail and delete this message from your
system. Thank you for your cooperation.
Reply | Threaded
Open this post in threaded view
|

Re: Report test

kaelog
thk

2006/2/7, Mathieu Vanderwhale <[hidden email]>:
Hi Kaelog,

Just take a look at http://www.openqa.org/selenium/testrunner.html. In
the Continuous Integration section, you will find what you are looking
for...

Enjoy,

Le Feb 7, 2006, à 10:00 AM, kaelog a écrit :

> First of all sory for my English, I'm French.
>
> Selenium's great and useful, but i did not found a to log what append.
> Not
> the log like in the selenium-ide, but a xml trace or something like
> that,
> which can produce a html, pdf... report.
>
> Hope I'm clear
>
> --
> @+
> Kaelog

Mathieu Vanderwhale, Analyst-Developer

Denali s.a., "Bridging the gap between Business and IT"
Châteaude Clerlande, B-1340 Ottignies, Belgium
Office: +32 10 43 99 51 Mob: +32 497 32 27 13 Fax: +32 10 43 99 52
Web: www.denali.beEmail: [hidden email]

Legal notice: this message and its attachments may contain confidential
and/or privileged information. If you are not the addressee or
authorized to receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any information
herein. If you have received this message by mistake, please advise the
sender immediately by return e-mail and delete this message from your
system. Thank you for your cooperation.




--
@+
         Kaelog
Reply | Threaded
Open this post in threaded view
|

Re: Report test

GW-5
In reply to this post by Mathieu Vanderwhale
Mathieu Vanderwhale wrote:

> Hi Kaelog,
>
> Just take a look at
> http://www.openqa.org/selenium/testrunner.html. In
> the Continuous Integration section, you will find
> what you are looking
> for...
>

Just wondering - on that page, where they mention under step 1 for continuous integration: "Create a servlet-type application ..."

Does anybody have such an application they'd be willing to share via this group?

Thanks,
-F.J.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1140&messageID=3228#3228

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Report test

Jason R Huggins
fj <[hidden email]> wrote on 02/07/2006 12:22:32 PM:

> Mathieu Vanderwhale wrote:
> Just wondering - on that page, where they mention under step 1 for
> continuous integration: "Create a servlet-type application ..."
>
> Does anybody have such an application they'd be willing to share via
this group?


Yes, I believe there is a an example of one on the Selenium wiki (but in
my 30 seconds of searching I couldn't find it.)

Also, I have a simple implementation of this in Python. I am *way*
over-due in cleaning up and releasing this.

The approach is simple, though. Write some kind of server side
script/method/function/servlet/whatever that is exposed as /postResults on
the server. Take the data that gets posted to "postResults" and dump it to
a text file. You'll have some metadata metrics like # of tests
passed/failed, the rest of the data will be a complete view of the HTML
selenium test tables "marked" up with the fancy red/green colors. Write
that data out to a file with the ".html" extension and you're good to go.
Your *next* task from a continuous integration point of view is to have
your cont. int. server parse that metadata and do whatever you need to do
with it. For example, use a regular expression to search the metadata to
see if the number of test errors is greater than zero, and if so, trigger
a build failure.

- Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Report test

Mathieu Vanderwhale
In reply to this post by GW-5
Hi FJ,

Here is my Java code for the Selenium servlet is talking about :

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

public class FetchSeleniumResults extends HttpServlet {

        public void doGet(HttpServletRequest request, HttpServletResponse  
response) throws ServletException, IOException {
                response.setContentType("text/html");
                String fileName =  
"/Library/Tomcat/webapps/ROOT/selenium/tests/TestResults.html";
                PrintWriter outHtml = new PrintWriter(new FileWriter(fileName));
                outHtml.println("<html>");
                outHtml.println("<head>");
                outHtml.println("<title>Selenium tests results</title>");
                outHtml.println("</head>");
                outHtml.println("<body>");
                outHtml.println("<p><B>Selenium tests results</B></p>");
                Enumeration enum = request.getParameterNames();
                while (enum.hasMoreElements()) {
                        String pName = (String) enum.nextElement();
                        String[] pValues = request.getParameterValues(pName);
                        outHtml.print("<b>"+pName + "</b>: ");
                        for (int i=0;i<pValues.length;i++) {
                                outHtml.print(pValues[i]);
                        }
                        outHtml.print("<br>");
         }
                outHtml.println("</body>");
                outHtml.println("</html>");
                outHtml.close();
        }
       
        public void doPost(HttpServletRequest request, HttpServletResponse  
response) throws IOException, ServletException {
                doGet(request, response);
        }
}

You need to deploy it on a Web Server (I did it under Tomcat in the  
SeleniumServlet webapps directory). Once deployed, you must configure  
your web.xml. Then, when you run TestRunner.html, you must pass the  
servler path in the URL under the resultsUrl parameter (like this for  
me :  
localhost:9006/selenium/TestRunner.html?auto=true&resultsUrl=/
SeleniumServlet/FetchSeleniumResults. The auto=true stands for the  
automated execution of the tests).

Voilà...

Hope it helps,

Le Feb 7, 2006, à 7:22 PM, fj a écrit :

> Mathieu Vanderwhale wrote:
>
>> Hi Kaelog,
>>
>> Just take a look at
>> http://www.openqa.org/selenium/testrunner.html. In
>> the Continuous Integration section, you will find
>> what you are looking
>> for...
>>
>
> Just wondering - on that page, where they mention under step 1 for  
> continuous integration: "Create a servlet-type application ..."
>
> Does anybody have such an application they'd be willing to share via  
> this group?
>
> Thanks,
> -F.J.
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=1140&messageID=3228#3228
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

Mathieu Vanderwhale, Analyst-Developer
 
Denali s.a., "Bridging the gap between Business and IT"
Château de Clerlande, B-1340 Ottignies, Belgium
Office: +32 10 43 99 51 Mob: +32 497 32 27 13 Fax: +32 10 43 99 52
Web: www.denali.be Email: [hidden email]
 
Legal notice: this message and its attachments may contain confidential  
and/or privileged information. If you are not the addressee or  
authorized to receive this for the addressee, you must not use, copy,  
disclose or take any action based on this message or any information  
herein. If you have received this message by mistake, please advise the  
sender immediately by return e-mail and delete this message from your  
system. Thank you for your cooperation.
Reply | Threaded
Open this post in threaded view
|

Re: Report test

GW-5
In reply to this post by GW-5
I committed some Java code to do this recently.

Get the latest code from Subversion and look in the java-fitrunner directory. There's a doc directory with some instructions which should be simple to follow.

It may be over complicated for your needs, but it demonstrates how you can run Selenium tests in IE from an ANT script and store the results.

Let me know if you have any questions. I've not announced this code yet as I wanted to get some doco on the Wiki first.

Cheers,
Darren.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1140&messageID=3239#3239

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Report test

GW-5
Thank you Darren and Matthew.
-F.J.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1140&messageID=3248#3248

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Report test

GW-5
In reply to this post by Mathieu Vanderwhale
Hello,

I implemented exactly the same way that you written in the article. But I don't know my resultsurl is not contacting the servlet. I am unable to create the testresults.html...


Please let me know where I am going wrong....

Thanks,
Usha
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1140&messageID=5530#5530

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]