Our .Net Client/Server application is using HTML table to display some results. One of the cells has 2 lines of data divided by the <p> tag. When I use the .GetCellData (i, 2) function it only displays the data from first line of the cell and not the second line. How can read the entire cell data? Below is the QTP code i'm using to get data and the source code of the cell.
Cells are recognized as WebElements. Doing the following i'm able to get the entire text from a cell but I have to hard-code Index # for the cell. But the problem is if I have more than 1 row of results then the index keeps changing. Anyway to handle this dynamically?
RajKumar, Thanks that works as well but the problem is cells are not uniquely identified by QTP. All use the <td> tag. When I get multiple rows of results, then cell index # changes and it throws off the script.
1. Try to get the cell below that row if you can get "Vol: V002, Weight: >= 22001 KG" by
SwfWindow("regexpwndtitle:=IRI.*").SwfWindow("swfn ame:=RateEnquiry").Page("micClass:=Page").WebTable ("class:=MsoTableGrid").GetCellData (i+1, 2)
2. In your webTable.ChildObjects code, use count to loop through the list of WebElement(use "html tag:=SPAN"), find the pattern which indexed webElement is what you need.