SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Aug 2000
    Location
    sanjose
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    converting results to .html file

    i need to convert the output to a html file , how can i do that in silk any thing to be incorporated into scripts??
    ram

  2. #2
    Member
    Join Date
    Sep 1999
    Location
    Boston
    Posts
    65
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    I'm working on a servlet to do this.. i'll post it and directions on how to use it soon. Email me in one week if i dont.

    -Brendan

  3. #3
    Junior Member
    Join Date
    Oct 2000
    Location
    San Francisco, CA , USA
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by ksr7777:
    i need to convert the output to a html file , how can i do that in silk any thing to be incorporated into scripts??<HR></BLOCKQUOTE>


    SilkTest has the capability to work with files; namely, a user can create, update and delete files. These are very useful functionalities, allowing a user, in particular, to create their own log files (e.g. see description of function FileOpen in the 4Test Language Reference). For example, the following code creates a log file with a header, containing information about a script, including date and time stamp and Copyright notice:

    String sScript = GetProgramName ()
    Datetime dtDt = GetDateTime ( )
    HFILE ghfLogf
    ghfLogf = FileOpen ( “C:\Test\Results\Log1.txt?, FM_APPEND)
    FileWriteLine (ghfLogf, “***** Log File for script {sScript}*****?)
    FileWriteLine (ghfLogf, “***** User: David Shtern. Log file created on {FormatDateTime (dtDt, “mmm dd, yyyy?)} at {FormatDateTime (dtDt, “hh:mm?)}.?)
    FileWriteLine (ghfLogf, “{Chr(0169)}{FormatDateTime (dtDt, “yyyy?)}, by Foo Corporation, All rights reserved.? )
    FileWriteLine (ghfLogf, Replicate (“*?, 50))


    The output of the script is a log file in text format, containing the following text:

    ***** Log File for script Test20.t*****
    ***** User: David Shtern. Log file created on Jul 13, 1999 at 10:15.
    ©1999, by Foo Corporation, All rights reserved.

    Now, assume that we are testing some Web pages and would like to log the following data into the log file (naturally, this may vary from application to application):

    a) Web page title
    b) Load time
    c) Datetime stamp
    d) Verification of an object on the page
    e) Testcase ID/name

    The easiest solution is to dump the information into a structured format (delimited by “|? character), like the one shown below:

    Page title|Load Time|Date|Time|Object Verified [Y/N]|Appstate|
    Index.htm|7.456|07/08/99|15:13|Y|One|
    Main.htm|2.213|07/08/99|15:17|Y|Two|
    Login.htm|1.156|07/08/99|15:21|Y|Three|
    Info.htm|5.456|07/08/99|15:25|N|Four|

    This file may be exported directly to MS Excel/Access or worked up by SilkTest; however it is inconvenient to read.

    It is also possible to write some code so that the information is placed in a table, rather than in structured text, as shown below:

    ------------------------------------------------------------------------------------------------
    Page title | Load Time | Date | Time | Object Verified [Y/N] | Appstate |
    ------------------------------------------------------------------------------------------------
    Index.htm | 7.456 | 07/08/99 | 15:13 | Y | One |
    -------------------------------------------------------------------------------------------------
    Main.htm | 2.213 | 07/08/99 | 15:17 | Y | Two |
    -------------------------------------------------------------------------------------------------
    Login.htm | 1.156 | 07/08/99 | 15:21 | Y | Three |
    -------------------------------------------------------------------------------------------------
    Info.htm | 5.456 | 07/08/99 | 15:25 | N | Four |
    -------------------------------------------------------------------------------------------------

    Readability is increased but still, there is plenty of room for improvement. Do you agree?

    Compare the same table in HTML Table format, shown below:

    I believe everyone would agree that the table above is cosmetically much more pleasing to the eyes than the previous two formats. How is a table such as this created? Believe it or not, the table is not created using an HTML editor but solely with SilkTest!

    How does one accomplish this? Well, to understand the principle, we should recall from the beginning of this article that SilkTest can create files. The examples given may mislead a user into thinking that only files in text format can be created. This is not the case – we may create files with any extension, including “html? and “htm?. Furthermore, we should recall, that an HTML file must contain at least the following lines of code:


    < !-- <HTML> -->

    < !-- <BODY> -->
    < !-- <TITLE>Report</TITLE> -->
    //some code here
    < !-- </BODY> -->
    < !-- </HTML> -->
    We can easily add this information using SilkTest. In addition, we can add some code for table creation and formatting. I will not describe the details here – the code for generation of the table can be downloaded.

    A few comments. We can change colors of table cells depending on testcase results – e.g. make the color of the cell of a failed testcase red, so it catches the attention immediately or color the header row in a different color. To be able to do this we must place a conditional statement in the code so SilkTest decides automatically what color to use:

    [-] select
    [-] case (sVeri== "Y")
    < !--
    FileWriteLine (fhHTML, "<TH BGCOLOR={sBlue}> {sVeri} </TH> </BGCOLOR>")
    [-] case (sVeri== "N")
    FileWriteLine ( fhHTML, "<TH BGCOLOR= {sRed}> {sVeri} </TH> </BGCOLOR>")
    default
    FileWriteLine ( fhHTML, "<TH BGCOLOR ={sBlue}> {sVeri}</TH> </BGCOLOR>")

    -->

    The possibilities are endless and are limited only by one’s imagination and available time. So, the next time you want to create an HTML file, consider using SilkTest to do so!

    [This message has been edited by goldshteyng (edited 10-25-2000).]

    [This message has been edited by goldshteyng (edited 10-25-2000).]

  4. #4
    Member
    Join Date
    Aug 2000
    Location
    sanjose
    Posts
    30
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    You are perfectly correct goldshteyng.

    I worked on the same lines to get my results in a file with .html

    Thanks a lot
    ram

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Boston, MA. USA
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    Segue's customer newsletter, segue@work, also had an article related to this topic - converting results into an HTML file. To access the article, here's the link (you will need your username and Segue customer ID# to access the newsletter): http://customers.segue.com/protected...tml_tables.htm

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Boston, MA. USA
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    Sorry - I would like to credit David Shtern, QA Manager, Pixo Corporation, as the author of the "Generating SilkTest Reports in HTML Format" article. It appeared in the August '99 issue of segue@work.

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    DrNice,

    What I've done is overload all the output methods in SilkTest and included in that overload the ability to write to HTML if that is desired. This option is flipped off and on in an ini file that Silk reads at the start of every script. I'm using methods such as _Print(), _Print1(),_Print2(), _LogError() etc. Each of these can be tied to a specific HTML output style and if the HTML output is set to true, then the same string that is passed to _Print() will be passed as an HTML string and written to that specific file.



    ------------------

  8. #8
    Junior Member
    Join Date
    Sep 2001
    Location
    Shrewsbury, MA, USA
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: converting results to .html file

    How can i use this to get my results file into html?

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:02 AM.

Copyright BetaSoft Inc.