Application is giving Search Result in the form of rows which QTP is recognizing as WEBTABLE & different cells(Columns) of the row as WEBELEMENTS.
These rows are changing when search criteria is different.
Can we export these WebTable(rows) or WebElements(Cells) to Excel so that Values of these Cells can be picked up???
I am unable to create Unique Identity of each cell or each row, because all properties are same except:
1. Co-ordinates: Cant use this because it changes with large data.
2. Innertext: Cant use this because dont know which data will come.
I need to pick values from different Webelements/cells/columns and do the comparison.
Set myExcel = Createobject("excel.application")
myExcel.visible = true
Set mySheet = myExcel.worksheets(1)
With mySheet.QueryTables.Add( "URL;http://news.bbc.co.uk/sport1/hi/football/eng_prem/table/default.stm", myExcel.Range("A1") )
.WebSelectionType = 3 ' This can be xlEntirePage(1),xlAllTables (2) or xlSpecifiedTables (3).
.WebTables = "5" 'Number of webtable
Thanks for the code... but as Tarun said it will work incase we provide url & also may be not for the runtime tables.
I have tried so many ways to get the values from the cells like:
set tableobj = Browser("List Manager").Page("List Manager").Frame("Frame").ChildObjects(tableDesc)
For i=0 to tableobj.count-1
reporter.ReportEvent micPass, "msg:", "This is coming: "&a&"."
But in this case it is giving values of all WebTables present in the screen except for that table which i need.
One more code:
Set oDesc = Description.Create()
oDesc("html tag").Value ="TD"
Set obj = Browser("List Manager").Page("List Manager").Frame("Frame_2").WebElement(oDesc)
This code worked because I supplied abs. coordinates in the description. It recognized the Web Element & retuned the value but it is fine for 1row, 1column as data increases or decreases it affects the abs. coordinates of other cells, there it is failing.
Whenever result is coming it is displaying as 1 WebTable whose Innertext contains all values of the cells.
So, please if can tell the code also for GETCELLDATA that would be great. I tried this but its cannot recognize this property...