UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Lieutenant
Lieutenant
389 views

How to run multiple iterations only on a set of lines in script

Jump to solution

Hello

Script is like below

Window("A").WinButton("Y").Click

            Dim i
            For i= 1 To 16 Step 1
                
                Window("A").Dialog(B").WinEdit("C").Set DataTable("Column1", dtLocalSheet) 
                wait(1)
                Window("A").Dialog("B").WinEdit("C").Set DataTable("Column2", dtLocalSheet)
                wait(1)
                Window("A").Dialog("B").WinButton("D").Click
       
            Next

Window("A").Dialog("B").WinButton("E").Click

 

In above script i am taking input from datatable and i need to take 16 entries from 16 rows.

Above script is in single action. i cant use multiple actions(i would have called mupltiple iteration for multiple action but have to use one action only)

How to make it work?

Regards

Amit

 

0 Likes
1 Solution

Accepted Solutions
Absent Member.. Absent Member..
Absent Member..

Put everything in a loop iterating over the rows in the datatable

 

Set objDT = DataTable.GetSheet("sheetname")

For intRow = i To objDt.GetRowCount
        objDt.SetCurrentRow intRow
         
                Window("A").Dialog(B").WinEdit("C").Set DataTable("Column1", dtLocalSheet) 
                wait(1)
                Window("A").Dialog("B").WinEdit("C").Set DataTable("Column2", dtLocalSheet)
                wait(1)
                Window("A").Dialog("B").WinButton("D").Click
     Next

View solution in original post

1 Reply
Absent Member.. Absent Member..
Absent Member..

Put everything in a loop iterating over the rows in the datatable

 

Set objDT = DataTable.GetSheet("sheetname")

For intRow = i To objDt.GetRowCount
        objDt.SetCurrentRow intRow
         
                Window("A").Dialog(B").WinEdit("C").Set DataTable("Column1", dtLocalSheet) 
                wait(1)
                Window("A").Dialog("B").WinEdit("C").Set DataTable("Column2", dtLocalSheet)
                wait(1)
                Window("A").Dialog("B").WinButton("D").Click
     Next

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.