Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to open html file and update values in particular cell of a table in QTP?
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi All,
I am new to QTP. I am writing code to generate report in html format. I have created table struture and everything.
Now after all my scenarios are executed i want to open the file again and update values in cells of a table.
Suppose i have 10 rows and 2 columns in a table. now i have opened file and want to go to 3 row 2nd column of a table...help me with this. sample code will be much helpful.
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Open the file in the edit mode by using '8'. then u can add the lines to it.
try the below sample code:

Code:
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objReport = objFS.OpenTextFile("file name with path", 8, True)
            objReport.Write "<TR COLS=5><TD BGCOLOR=#EEEEEE WIDTH=25%><FONT FACE=VERDANA SIZE=2>" & "Your Lines" & "</FONT></TD></TR>"

Thanks.
Harish
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks a lot harish. got some idea.
one query,
in our result report which is html file, if i have 3 tables and now i open the file with append mode(which u said) the cursor will be at the end of the last line of the last table right!.. then if i want to update value in second table how to move cursor to second table..can we assign id's to tables and its elements while creating itself?
If yes can u give me some sample code to give id's to table, coulmn,row

Thanks for your input. it helped me a lot.
One query,
In my html file i have 3 tables, if i open html file in append mode then the cursor will be at the end of the last line of last table. how to update values into the second(middle) table cells? can we define table,row,column,cell with id's? if yes can u plz send me the sample code?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OpenNewTab stopped working on IE after unknown windows update M851533 0 1,103 07-19-2018, 08:36 AM
Last Post: M851533
  unable to open file-new functionlibrary sirim 2 1,901 03-03-2017, 12:22 PM
Last Post: vinod123
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,850 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
  Customized HTML reports in QTP azeem 11 49,430 12-31-2016, 02:57 PM
Last Post: chevronneraji
  [UFT] Get text into DIV through HTML tag robertosalemi 2 5,517 03-29-2016, 09:43 PM
Last Post: robertosalemi

Forum Jump:


Users browsing this thread: 2 Guest(s)