[eggPlant Functional] Reporting Results on the Web

Run the HTMLReport script in this Reporting suite and it will ask you to select a suite. Select one of your existing Eggplant suites and an HTML document will be produced listing the status of the most recent run of every script in that suite.

The report is produced from an HTML Template file (found in the Scripts directory within the suite) that can be edited to customize the look and contents of the report. Two different sample templates are included to get you started.

With a little bit of work it should be relatively easy to incorporate this script into your test environment, and adapt it to generate pages accessible on your company's website or intranet, or directly from the Eggplant machine (by enabling Personal Web Sharing in System Preferences).

Comments

  • Doug, where can I find the new Reporting suite, I have the older version and I'm getting the same error.

    thank you
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Hi -- There was a problem with the configuration of the forum software, which made the downloads unavailable. Thanks for bringing it to our attention.

    We've got it corrected now, so you should be able to download the current version of the Reporting suite again (at the end of the initial post on this topic).
  • Hi , Reporting Suit provides me only the script output pass or fail .

    But it does not give me the detail at each step

    e.g. I need the information for each put command
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    The name of the log file containing the detailed execution log for each run of a script can be found using the ScriptResults() function. Here's a sample script that shows how you could use this function to access the log for the most recent run of each script in a suite.
    (* outline of a script to report the details of latest run of each script in a suite *)
    put my folder's folder into suitePath
    put "Suite: " & suitePath
    set scriptFolder to suitePath & "Scripts"
    repeat with each scriptName in the files of scriptFolder
    	if scriptName is my name then next repeat -- skip me
    	put scriptName & ":"
    	-- get information on the most recent run of that script
    	get the last item of ScriptResults(scriptName)
    	if it is empty then next repeat -- skip; no results
    	put file (the LogFile of it) into detailedResults -- get log file contents
    	-- process detailedResults here
    	put the last three lines of detailedResults -- example
    end repeat
    
    Use this as a starting point and adapt it for your needs, such as by using the techniques shown in the HTMLReport script to report the results that you're interested in on a web page.
  • I've just attempted to use this suite in a Windows XP environment and when I select the suite folder I just get the message "There are no test results for suite suitename.suite.

    Do I need to make any alterations for the Windows XP environment? There is a .csv in that folder with a bunch of results in it so it's going wrong somewhere (or I am!).
  • EggplantMattEggplantMatt ForumAdmin admin
    You'll need to modify the FullSuitePath method of the latestSuiteResults script. Starting with the line:
    if suite does not begin with "/" then
    
    it's expecting Unix-style paths, not Windows paths. You could probably remove the call to that function and just assume that you've got the full path. If you find that you sometimes don't get the full path, then you can worry about modifying that code.
  • I downloaded Reporting Suite and ran HTMLReport script but it is not asking me to select a suite. Actually nothing happens. Do I need to configure something to use this script?

    I was trying to see the HTMLReporte script but when I tried to open it from eggPlant I cannot see the code (script is blank) but using notepad I see the following:

    \f1\b \cf3 put
    \f0\b0 \cf0 \cf4 "StatusReportTableTemplate.html"\cf0
    \f1\b \cf3 into
    \f0\b0 \cf0 \cf5 templateName\cf0 \
    \cf2 --put "StatusReportListTemplate.html" into templateName -- alternate template using a list\cf0 \
    \
  • EggplantMattEggplantMatt ForumAdmin admin
    Which version of eggPlant are you trying to open the Suite in? The codes that you see when you open the scripts in NotePad are because the scripts were saved in Rich Text Format. All versions of eggPlant can open/read scripts saved as RTF, but saving in that format is no longer an option. If you are having trouble opening the scripts on Windows, open them in WordPad first and use Save As... to save them as plain text.
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    I've replaced the Reporting suite with an updated version that addresses a couple of problems. The scripts are now in plain text format so there shouldn't be any problem with examining them or making changes. I also updated parts of the script that work with file paths to use some newer capabilities (the script was originally posted here 7 years ago!). This should enable it to work properly on all platforms (Windows as well as Mac and Linux).

    Please download the suite again, and let us know if you run into any other issues.

    Also, the HTML templates included with the suite aren't very interesting. If anyone develops some better ones, it would be nice if you would share those here. Thanks!
  • Is there a way to modify the HTMLReport script in the Reporting suite so that it would not ask to select a suite manually? I would like to run several scripts from the suite overnight and automatically generate the HTML report.

    Thanks,

    Hanna
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Sure. The part of the HTMLReport script that asks the user to select a suite is this line:
    answer folder "Select a Suite" in folder myPath -- let the user choose a suite
    
    You can enable the script to be called from another script by replacing that line with this code:
    (* Allow the suite to be passed in as a parameter.
    Only ask the user for the suite if one wasn't provided.
    *)
    get param(1) -- get the first parameter passed to this script
    if it is empty then answer folder "Select a Suite" in folder myPath -- let the user choose a suite
    
    That will check whether the script was called with a parameter and use that as the suite to report on without asking the user. With this change in place you can write another script that calls it like this:
    HTMLReport "/full/path/to/my.suite"
    
    There are a couple of other answer commands in the script, which will also need to be avoided when it is called in this way so that it can run unattended. I'll try to post an updated version that deals with all of this nicely when I get time. Meanwhile you may want to just comment those lines out.
  • Thank you so much. It worked fine and I am getting the results displayed almost the way I wanted them. Almost, because I do not know how to automatically reset the statistics. I know that it can be done manually on the script level but what about the suite? When I get the reports of the suite execution, the old script runs information is included. Deleteing the Resutls folder does not help. Any idea what I can do?

    Thanks,

    Hanna
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    I've updated the HTMLReport script in the suite so that it can be called from another script, passing in the suite name as a parameter. I also corrected a small issue in the templates that would throw an exception for some suites with bad values in their SuiteStatistics file.

    As for resetting the statistics, if you delete or rename a script from within eggPlant, the SuiteStatistics.csv file will automatically be updated appropriately. But if you delete or rename a script file directly in the file system, eggPlant isn't able to do this, and you can end up with information in that file for scripts that no longer exist. In this case you may want to edit the file directly (when eggPlant isn't running) and remove any obsolete lines.
  • vkazavkaza Member
    Hi,

    This is an awesome suite and works for me. However, I need a suggestion regarding this. can someone suggest, how do I save the html report that is generated here. I wish to send the html report over email or provide a link to that.

    Thanks,
    Vasavi
  • Any response for this thread?
    I want to send email to few after the executione.
  • Same question here as mentioned above :oops:
  • it is not working ,
    Showing No results found
    :( :(
  • vitaluvitalu Member
    Hi,
    I am able to create HTML report.
    Now, I want to edit the HTML SenseTalk's template. Because I want to modify some text and colors as of my wish.
    Please provide me solution how to edit the template and this template where can I edit in eggPlant.

    And also please provide me how to display my "LogFile" results instead of suitestatistics.csv

    Thanks
Sign In or Register to comment.