Micro Focus QTP (UFT) Forums
Switching Links to contnue testing - 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: Switching Links to contnue testing (/Thread-Switching-Links-to-contnue-testing)



Switching Links to contnue testing - mv8167 - 10-05-2011

Attached is a PDF that shows more of my question. My goal is to find a way to switch page links and then reuse my code that already works on the first page.

I just can not figure out the best way to go from page to page (anmd skip those that intend to skip) to run then the same code as before.

Any thoughts to help?


Lor


RE: Switching Links to contnue testing - mv8167 - 10-05-2011

I am attaching my code, that I need to minimize.

Yes, I would like to add a Data Table, but I am already using Global and the Action1 tables. I am trying to add another Action tab.

see new attachment


RE: Switching Links to contnue testing - mv8167 - 10-06-2011

I created an Action2, but i am not sure if this helps or hurts my future testing.

My new code in Action2:

Code:
For DLc = 1 to 5
            DLcRun=  DataTable.GetSheet("Action2").GetParameter("Execute").ValueByRow (DLc)
            DocumentsLink = DataTable.GetSheet("Action2").GetParameter("DocumentsLink").ValueByRow (DLc)
            GrStart = DataTable.GetSheet("Action2").GetParameter("GrStart").ValueByRow (DLc)
            GrEnd = DataTable.GetSheet("Action2").GetParameter("GrEnd").ValueByRow (DLc)
            
               If DLcRun = 1 then
                    'Check to see if the correct ReportsLink is selected, if not , then change
                    If Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link(DocumentsLink).Exist(1) Then
                        Browser("Wisdom").Page("Wisdom IA").Frame("parent").Link(DocumentsLink).Click
                        Reporter.ReportEvent micDone, "ReportsLink was changed: " , " The Image Access reports link in " & ENV & " was changed to: " & ReportsLink & "."
                    End If
                    
                    Call CountNumberofReportLinks (GrStart, GrEnd, objExcel, OutputFilePath, rNumber, MrNumber)
                    Call SaveOrSaveAsExcelSheet (OutputFilePath, objExcel)
                    Call UseGroupReportDisplaySearchAddFav (GrStart, GrEnd, objExcel, OutputFilePath, MrNumber)
                    Call SaveOrSaveAsExcelSheet (OutputFilePath, objExcel)
            
                Else
                    Reporter.ReportEvent micDone, "Documents Link Skipped: " & DocumentsLink , "Execute in Action2 set to 0 for documentklink."
            
            End If
Next