Micro Focus QTP (UFT) Forums
Multiple records - 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: Multiple records (/Thread-Multiple-records)



Multiple records - mahadevan.swamy - 09-29-2008

Hi,
I am very new to QTP and I am given the following problem. I have a list of invoices in the application and I have to make sure the every invoice I click, should display some details. I have thought of looping the script but sometimes that doesn't work. Can anyone suggest me an idea on how i can solve this problem? Thanks


RE: Multiple records - mahadevan.swamy - 09-29-2008

For example, I have a manual generated script here
Code:
Browser("UWindsor").Page("ENG").Frame("_sweview_2").Image("Select record").Click
Browser("UWindsor").Page("ENG”).Frame("_sweview_3").Link("Line Items").Click
Browser("UWindsor").Page("ENG").Frame("_swescrnbar").Link("Invoices").Click
'Browser("UWindsor").Page("ENG").Frame("_sweview_4").Image("Select record").Click
'Browser("UWindsor").Page("ENG").Frame("_sweview_5").Link("Line Items").Click
'Browser("UWindsor").Page("ENG").Frame("_swescrnbar").Link("Invoices").Click
'Browser("UWindsor").Page("ENG").Frame("_sweview_6").Image("Select record").Click
'Browser("UWindsor").Page("ENG").Frame("_sweview_7").Link("Line Items").Click
'Browser("UWindsor").Page("ENG").Frame("_swescrnbar").Link("Invoices").Click
--------------

I have written a looping code

Code:
Browser("UWindsor").Page("ENG").Frame("_swescrnbar").Link("Invoices").Click

Browser("UWindsor").Page("ENG").Frame("_sweview").Link("Line Items").Click
Browser("UWindsor").Page("ENG").Frame("_swescrnbar").Link("Invoices").Click

i=2
While i<=10
    Browser("UWindsor").Page("ENG").Frame("_sweview_"&i).Image("Select record").Click    
    i = i + 2
Browser("UWindsor").Page("ENG").Frame("_sweview").Link("Line Items").Click
Browser("UWindsor").Page("ENG").Frame("_swescrnbar").Link("Invoices").Click
Wend
Browser("UWindsor").Page("ENG").Sync
-----
When I run this looping code, I get the error message that the "_sweview_8" frame object repository was not found in the object repository. Can anybody suggest what i should do? Thanks


RE: Multiple records - kishoreinchennai - 09-30-2008

Hi

If it can recognise sweview2,4,6 and why not 8.do u have a frame called sweview_8 in your OR ?!!!!!if not you need to include that

regards