Hi everybody... I'm kind of new to scripting in QTP. I am trying to automate the validation of Crystal reports results using QTP. We used to do it manually using SQL scripts earlier. The reports are in html format. Now, there are a few reports that have large results set which run into more than one page. there are about a thousand rows of data that are to be validated against the sql results.
Since I did not find any easy way to do it, I thought VBScript is the only answer. I thought we can create two arrays and populate one with the report's values and the other with the SQL values. And then compare them. I figured a way to popuplate the array with SQL values. Is there any way to extract the values from the report. If so how?? The values are in a webtable format and are in more than one page. Also, I can export the report values to excel, word or PDF.
I was trying the follwing code but there seems to be a problem.
ListSize = Browser("InfoView").Page("InfoView").Frame("worksp aceBodyFrame").WebTable(" ??").GetTOProperty ("itemscount")
ReDim arrLoanId(ListSize - 1)
For i = 1 To ListSize
set arrLoanId = Browser("InfoView").Page("InfoView").Frame("worksp aceBodyFrame").WebTable(" ??").GetCellData(i,"Loan ID")
The name of the webtable is not clear. It is a nested table and I'm not sure about the name of the second table from which the data is to be retrieved (Please see attachment). The name of the table that I see from the Object viewer is unbelievably long. The html tag for the webelement is SPAN. i'm using QTP 9.2 and need to populate the array using the column 'Loan ID', so that I can compare the values with the data from the database(another array). Please let me know where I'm going wrong.
Tarun, I know I have to add the last table in the hierarchy to the OR. But my question was I cant identify the name of the table. Is it the long name that I marked in the attachment? It looks like it is taking a the name of the table dynamically(has the date and time included).
The question you asked in the attachment: No it wasnt the name of WebTable, though it showed the content as well in the name jsut to distinguish in the O.Rep .Dont bother about the name of the webtable as it apperas in O.Rrep (because you can change the name), as long as it can be identified & highlighted by QTP.
Do one thing, print all the contents of the webtable (which holds all other desired webtables in it that you want to retrieve contents from) in row + column. If there is no celldata, skip it & proceed.
"life is simple if you can see both sides of a coin" - by me