Micro Focus QTP (UFT) Forums
Excel to HTML results - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Excel to HTML results (/Thread-Excel-to-HTML-results)



Excel to HTML results - keerthi286 - 04-18-2013

Hi all,

I wrote a QTP script which is storing the output values in excel sheet, but my team asked us to write the script that will store the output results in HTML.I don't know anything about HTML.I am new to HTML.Can anyone help me how to write the HTML code to get the result in HTML format.[/size][/font]


RE: Excel to HTML results - basanth27 - 04-19-2013

If I were you, Here is what i would have done,

1. http://www.w3schools.com/html/ - This contains the starter set for you to understand HTML from the basics. Try to learn as much as you can, practice the code and probably try out a few tests based on the learnings.

2. A HTML is a file. You can read and write to it using the FileSystemObject. Learn about how FileSystemObject works, create a blank html file using the filesystemobject. If you know this already, you are one step ahead Smile

3. You will have to create a header before you start filling the rows. A header is a static data and it will need to be created once the file is created. For Eg:
Code:
Test_Case_ID  Description  Expected Result   Actual Result  Status

4. Here comes the difficult part - For each test case you execute you will have to write the results under the header. This is dynamic data. So you will have to parametrize the values you want each to appear. I suggest you write a function which will accept your dynamic values and fill them under the header.
Here is how it will look once you fill the data,
Code:
Test_Case_ID  Description  Expected Result   Actual Result  Status
TC_001           Fill values   values to be filled  Values filled     Pass
TC_002        check numeric Require Numeric    Not numeric    Fail

5. If you have completed step 4 then it is a cakewalk from here. You will have to fine tune your report.
5.1 Make sure for each execution it generates the report with a unique naming convention.( Ideally create with the time and date stamp)
5.2 Decide if you want to append the results.
5.3 Cosmetic modifications like Logo, Dashboard and execution time will have a good presentation effect.

And probably many more depending upon your creativity.

Give it a try and let me know if it helps you Smile