Micro Focus QTP (UFT) Forums
GetItem - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: GetItem (/Thread-GetItem)



GetItem - mv8167 - 08-28-2012

Curremntly, I have been using:

Code:
hwndZip =  Window("text:=" & ZipDialogName & ".*").GetROProperty("hwnd")
SetobjWinListView = Window("hwnd:=" & hwndZip).WinListView("nativeclass:=SysListView32", "Location:=0")
Call objWinListView.WaitProperty("visible", "true", 10000)
objWinListView.Highlight
ItemCountZip =objWinListView.GetItemsCount

Where ItemCountZip  = 1
But when I use:
Code:
For PDFCount = 0 to ItemCountZip - 1
       PDFReportName = objWinListView.GetItem(PDFCount)

I get an error the SysListView32 is not recognized.

Error Message: Cannot identify the specified item of the [ SysListView32 ] object. Confirm that the specified item is included in the object's item collection.
Line (12):
Code:
"PDFReportName = objWinListView.GetItem(PDFCount)".


I have looked this up but I have read neo answer. am i using perhaps the wrohod?

thx


RE: GetItem - QTPScript - 08-30-2012

Hello

I have some question or doubt in for condition.

For example PDFCount = 0 to ItemCountZip -1 for this formula ( start with 0 and end with 0) .

Now zero(0) will go to the PDFCount as getItem ...

that's can be problem.

For more help. Please let me know what is 0 Value and 1 value. if 0 have value then you will receive else not.

Modify code to ...remove the -1 and try to run..You will receive 2 out put..one is 0 and 1


RE: GetItem - mv8167 - 08-31-2012

thx QTPScript for your time


There is only one selection with the SysListView32 area.

Using SysListView32, i cannot exactly pick the report that i need. From my reading/research the first opbject using SysListView32 is always 0 (zero).

I have tried PDFCount = 1 to ItemCountZip for this formula (start with 1 and end with 1) but this errors also.

L