Webtable Issue in IE8
I created QTP automation scripts for a web application in IE 6 browser.
The below line of code gave me correct result for a webtable in IE6.
strValue = Browser("B").Page("P").Webtable("WT").GetCellData( 5,2)
However the same table has only 4 rows in IE8 browser.
Can anybody let me know as to how to make the same line of code work in IE 8 browser.
Windows XP with service pack 3
IE 8 browser
If you are sure that, the data exists more than 4 rows, it should work. Cross check manully at this point of time.
If the problem still persists, try B().P().WT().RefreshObject, before retrieving the cell value.
Also try B().P().WT().Init if the above method doesnt fix your problem
Last edited by udayanem; 06-18-2013 at 03:33 AM.
Could you have a conditional statement on the browser? i think that there is an environment varible knowing which browser you are using. Something such as
If Environment("Browser") = "IE6" Then
' Get the data
'Get the data the other way.
If it's even worth keeping the IE6 code. We dropped support for it years ago when usage dropped below 5%.
I have not used IE6 for many years.
As I can see from your script, the IE6 displays 5 rows and now the IE8 only displays 4 rows, it is correct?
So it's not issue of QTP.
If the content is designed to display only 4 rows in IE8, then you should create a condition like bklabel1 suggested. Otherwise, ask developer to fix it.
Yes it's displayed based on the compatibility as suggested by Kinghai....
you can check if below works for you
irows = Browser("B").Page("P").Webtable("WT").GetRoPropert y("rows")
strValue = Browser("B").Page("P").Webtable("WT").GetCellData( irows, 2)