I am using QTP 9.1 to automate test cases.The application has an UltraWinGrid and am trying to find a row using a search strig.I want to find the rowcount to loop through the rows to find out my search string.When I used rowcount property,I got a message saying this property is not supported.
Please let me know how do I go about that.
Thanks,
RamPriya
Its taking 3 minutes for me also. Sorry, I mentioned wrong at my earlier post. If you find some solution, let me know.
Hi,
Can you please me the solution that worked fine for the above issue. I am also facing the same challenge in our application. I tried with the code suggested by others in this page. But its consuming around 3 minutes for 5000+ rows.
Hi Ammar,
I wanted to fetch the data on first visible row from filtered grid. I used your above code. Its working fine. Now the issue is, our application have 5100+ rows in the grid at present and may extend till 50000 once the application goes into the final use. The above code is taking time depending on the row we filtered. Suppose my row is somewhere near 4000th row in total rows, it takes around 1minute to get me the filtered value as it iterates row by row. So, it would be helpful if you provide an alternative for this. Something like to fetch directly the row displayed after filtering would reduce the time consumption as there will be only 1 or 0 row filtered in our application.
Thanks and regards,
Neeta
Yes, in our case we had to loop around for the index values. Thanks for the information.
Hi Karthik,
It all depends on what information you need, what you need to do with the information, and how dynamic that data is or needs to be. Ideally in a testing scenario, your tests should always be predictable, in which case, you can always access the data directly. In the case that you need to dynamically access columns and rows that you are unsure of the quantity or values that you will end with, that is when you should loop through the data, because you don't know at that time where the data you need is.
But on the other hand if you know you have exactly five columns, then it is likely that you also know either their index, or their column keys. In which case you can use the same methods we did for looping, but instead hard code your indexes\keys.
iColIndex = 4strColKey = "Name"SET grid = SwfWindow("Form1").SwfTable("ultraGrid1")msgbox grid.GetNAProperty("DisplayLayout.Bands[0].Columns["+CSTR(iColIndex)+"].Header.Caption")msgbox grid.GetNAProperty("DisplayLayout.Bands[0].Columns["+strColKey +"].Header.Caption")
Let me know how this works for you,