Hi Naveen,
  To genarate an HTML report the below code will help u.

    Public intStepNo, strMod, strScenario,intPass,intFail


strInpMsg = "No Input Required"
Set objBrw = Description.Create
Public strResultPath1

Public Function CreateRepFile

        intStepNo = 0
        intPass = 0
        intFail = 0

        Dim fso, MyFile
        Set fso = CreateObject("Scripting.FileSystemObject")
        Set MyFile = fso.CreateTextFile(strResultPath1, True)

        ' Report  Title & Header

        MyFile.WriteLine("<HTML>")
    MyFile.WriteLine("<body leftmargin='7' marginwidth='20'
topmargin='7' marginheight='10' bgcolor='D2ECFF'  vlink='#9966cc'>")
        MyFile.WriteLine("<table width=100% border=0 cellspacing=0
cellpadding=0>")
        MyFile.WriteLine("<tr>")
        MyFile.WriteLine("<td style='color: #666666; font-size: 22pt; font-
family: Mic Shell Dlg; background-color:
LIGHTSTEELBLUE'><Center>Automated Test Execution Report</td>")
    MyFile.WriteLine("</tr>")

        MyFile.WriteLine("<tr><td><BR></td></tr>")

        MyFile.WriteLine("<tr>")
        MyFile.WriteLine("<td style ='color: #999; font-weight: bold; font-
size: 18pt; font-family: Mic Shell Dlg; text-align: center; padding:
2px 3px; border-bottom: 3px dotted #999'><p><span style='color:
#666666; font-size: 14pt; font-family: Mic Shell Dlg; background-
color: D2ECFF ; text-align: center; font-weight:normal'>TestCase: </
span><span style='color: 8B7E5A; font-size: 14pt; font-family: Mic
Shell Dlg; background-color: D2ECFF ; text-align: center; font-weight:
bold'>"&strScenario&"</span></p>")
        MyFile.WriteLine("</td>")


        MyFile.WriteLine("</tr>")
        MyFile.WriteLine("</table>")

        MyFile.WriteLine("<BR>")

        MyFile.WriteLine("<TABLE WIDTH='450' BORDER='0'>")

        MyFile.WriteLine("<TR>")
    MyFile.WriteLine("<TD WIDTH='35%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2><B>Date:</B></FONT></TD>")
        MyFile.WriteLine("<TD  WIDTH = '65%'  BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2>" & Now & "</FONT></TD>" )
    MyFile.WriteLine("</TR>")

        MyFile.WriteLine("<TR>")
        MyFile.WriteLine("<TD WIDTH='35%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2><B>Build:</B></FONT></TD>")
    MyFile.WriteLine("<TD WIDTH = '65%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2>" & strBuild & "</FONT></TD>")
    MyFile.WriteLine("</TR>")

        MyFile.WriteLine("<TR>")
        MyFile.WriteLine("<TD WIDTH='35%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2><B>Type of Testing:</B></FONT></
TD>")
    MyFile.WriteLine("<TD WIDTH = '65%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2>" & strTestType & "</FONT></
TD>")
    MyFile.WriteLine("</TR>")

        MyFile.WriteLine("<TR>")
        MyFile.WriteLine("<TD WIDTH='35%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2><B>Module:</B></FONT></TD>")
        MyFile.WriteLine("<TD WIDTH = '65%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2>" & strMod & "</FONT></TD>")
        MyFile.WriteLine("</TR>")

        MyFile.WriteLine("<TR>")
        MyFile.WriteLine("<TD WIDTH='35%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2><B>Scenario:</B></FONT></TD>")
        MyFile.WriteLine("<TD WIDTH = '65%' BGCOLOR='D2ECFF'><FONT
FACE='VERDANA' COLOR='#666666' SIZE=2>" & strScenario & "</FONT></
TD>")
        MyFile.WriteLine("</TR>")

        MyFile.WriteLine("</TABLE>")

        MyFile.WriteLine("<BR>")
        MyFile.WriteLine("<DIV style='color: #999; font-weight:bold;font-
size: 18pt; font-family: Mic Shell Dlg; text-align: center; border-
bottom: 3px dotted #999'>")
        MyFile.WriteLine("</DIV>")
        MyFile.WriteLine("<BR>")

        MyFile.WriteLine("<table width=100% border=0 cellspacing=0
cellpadding=0>")

        MyFile.WriteLine("<tr>")
        MyFile.WriteLine("<td style='color: #666666; font-size: 16pt; font-
family: Mic Shell Dlg; background-color: LIGHTSTEELBLUE ; text-align:
center; '>Step Execution Details </td>")
        MyFile.WriteLine("</table>")


        MyFile.WriteLine("<TABLE COLS=5 WIDTH='100%' BORDER=0  cellspacing=3
RULES=GROUPS  FRAME=BOX bgcolor='white'>")

        MyFile.WriteLine("<TR>")
        MyFile.WriteLine("<TD WIDTH='5%' BGCOLOR=BACDCD><FONT FACE='VERDANA'
COLOR='666699' SIZE=2><B>S.No</B></FONT></TD>")
        MyFile.WriteLine("<TD WIDTH='50%' BGCOLOR=BACDCD><FONT FACE='VERDANA'
COLOR='666699' SIZE=2><B>Description</B></FONT></TD>")
        MyFile.WriteLine("<TD WIDTH='15%' BGCOLOR=BACDCD><FONT FACE='VERDANA'
COLOR='666699' SIZE=2><B>Input Data</b></FONT></TD>")
        MyFile.WriteLine("<TD WIDTH='20%' BGCOLOR=BACDCD><FONT FACE='VERDANA'
COLOR='666699' SIZE=2><B>Output</B></FONT></TD>")
        MyFile.WriteLine("<TD WIDTH='10%' BGCOLOR=BACDCD><FONT FACE='VERDANA'
COLOR='666699' SIZE=2><B>Status</b></FONT></TD>")
        MyFile.WriteLine("</TR>")

        ' Close the file
         MyFile.Close

End Function


Regards,
Eswar
+91-9663384243

On Sep 21, 1:16 pm, naresh goel <[email protected]> wrote:
> Hi all,
>
> Any one havig source code to generate test result in html format with
> tree view in one frame and nodes details in other frame.
>
> Like i am working in keword driven framework and i have been given
> task to generate test result in tree view ie customized mode.There are
> 2 frame first frame is having tree view with contents Test Suite,Test
> Scenerio,Test Cases and Test step.If  click Test Suite it expands the
> Test Scenerio and when i click test scenerio it expands various test
> case and when i click on test case the other frame displays the test
> status,description,snap shots and blah blah.. .
>
> Hope every one has understood my requirement
>
> Waiting for promt reply
>
> Regards
> Naveen Shrivastava

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to