Hello All,
QTP Version : 9.2Add -ins - .Net,WPF, Infragistics TestAdvantage
While working with a SWftable, for the first time it executes without a issue while the same code in the action repeated throws the error "Object REference not set to a instance". Here is the code,
rows=Browser("BRW").Window("Win").swftable("tbl").object.rows
for r=0 to rows-1
user_val=Browser("BRW").window("win").swftable("tbl").getcelldata(Cint(r),"EntryName")Next
It throws the error when it reaches user_val. Is there a alternative for getcelldata ?? IF i can use the object properties to retrieve the cell data it would be wonderful.
I tried swftable().object.rows(1).cells(0).value and it did not work.
Can anyone please take a look at it ??
Warm Regards,
Robert
Hi Rebert,
I noticed that you are using ".Object.Rows" you should use ".Object.Rows.Count" instead
If that did not work you can try the GetNAProperty here how to do it:
rows=Browser("BRW").Window("Win").swftable("tbl").GetNAProperty("Rows.Count")
Cell_val=Browser("BRW").window("win").swftable("tbl").GetNAProperty("Rows["+CSTR(r)+"].Cells[EntryName].Value")
Cell_Text=Browser("BRW").window("win").swftable("tbl").GetNAProperty("Rows["+CSTR(r)+"].Cells[EntryName].Text")
Next
I hope that will help,
Regards,
Ammar
Hello Ammar,
Oops !! I am sorry...i missed to include Count. I tried with the GetNAProperty but still it throws the same error message stating " Object Reference Not set to a instance of an object".
Thank you very much for the quick response.