Micro Focus QTP (UFT) Forums
How to run multiple localdata table from a action - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to run multiple localdata table from a action (/Thread-How-to-run-multiple-localdata-table-from-a-action)



How to run multiple localdata table from a action - upadhyay40 - 12-07-2009

Hello All,

I have 5 actions, in 1st action i have data table localsheet for UserName i.e. "UserID" and in last action i have 7 data table localsheet for checking 7 different fields,
1st iteration it works fine but when i will come to the next iteration it takes 2nd user and in last action where i define 7 localsheet it throws exception

General run error.
Line (24):
Code:
"EditCollection(i).Set Datatable("SurveyID", dtLocalSheet)".

where as same code is worked properlly in login action for "UserID" localsheet

can anybody explain it to me, how can i solve this problem.

Thanks

Mahesh


RE: How to run multiple localdata table from a action - sreekanth chilam - 12-07-2009

Hi,

@ALL: Going forward request you to be precise and clear in asking questions/queries.

@Mahesh: Please could you explain your issue clearly so that we could visualize and help you out.
If possible paste your code.


RE: How to run multiple localdata table from a action - upadhyay40 - 12-07-2009

Hi shreekant,

Please find attached screenshot, this is a code for it please see it and let me know if it has some problem

Code:
Dim EditToSearch,EditValueToSet, NumberOfEdits,LinkToSearch,LinkValueToSet, NumberOfLink,lengthO,SurveyID,a
        
               'This is the value of the 'name' property for the WebEdit object we want to find.
               EditToSearch = "txtSurveyID"
             'Create a description object to help retrieve all WebEdit objects in a specific page.
              Set loginDesc = Description.Create()
                  loginDesc("micclass").Value = "WebEdit"
                  loginDesc("name").Value = "txtSurveyID"

             'Retrieve all WebEdit objects in this page
              Set EditCollection = Browser("Add Survey").Page("Add Survey").ChildObjects(loginDesc)
                  NumberOfEdits = EditCollection.Count
                             'Search for a specific Linkobject and set its value
                For i = 0 To NumberOfEdits - 1
                    If EditCollection(i).GetROProperty("name") = EditToSearch Then
                       EditCollection(i).Set Datatable("SurveyID", dtLocalSheet)
                       ' WriteResults "Enter UserID Succesfully","Corporate User Login","User Enter value 'SYSADMIN'"
                     End If
                Next
Browser("Add Survey").Page("Add Survey").WebButton("Next").Click

If Browser("Add Survey").Dialog("Microsoft Internet Explorer").Exist Then

SurveyID = Browser("Add Survey").Dialog("Microsoft Internet Explorer").Static("Survey ID must contain").Check (CheckPoint("SurveyIDCheckAlpha"))
.
.
..
.
.
Thanks
Mahesh