Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dependent iteration between global and localsheet
#1
Not Solved
Hi,
I want to control localsheet iteration based upon globalsheet.

e.g.-I have 3 worksheets in an excel file-
1)globalsheet
2)local1
3)local2

the 1st row in all the 3 sheets contain testcase ids.


I want to run the script so that it will pick the 1st value from the globalsheet ,will move to the next worksheet,pick the corresponding values from all the columns for which the row no is 1 and then move to the next worksheet and do the same.

The worksheet is individual for each action which is based on individual page according to the application.

Please take a look into the attached excel file.(rename the file to ".xlsx" since i am not allowed to upload an excel file
.txt   New Microsoft Office Excel Worksheet (2).txt (Size: 13.5 KB / Downloads: 127) )
Reply
#2
Not Solved
Hi,
the script might look like this:
Code:
For i = 1 To DataTable.GlobalSheet.GetRowCount
        
        globalTCID = DataTable.GlobalSheet.GetParameter("TCID").ValueByRow( i )

        For j = 1 To DataTable.GetSheet("Local1").GetRowCount
               If DataTable.GetSheet("Local1").GetParameter("TCID").ValueByRow( j )  = globalTCID Then
                     ' do the test for data in row nbr 'j'
                     MsgBox( globalTCID & " -- Last name  -----> " & DataTable.GetSheet("Local1").GetParameter("Last_Name").ValueByRow( j ) )
               End If
        Next

        For j = 1 To DataTable.GetSheet("Local2").GetRowCount
               If DataTable.GetSheet("Local2").GetParameter("TCID").ValueByRow( j )  = globalTCID Then
                     ' do the test for data in row nbr 'j'
                     MsgBox( globalTCID & "-- VIN  -----> " & DataTable.GetSheet("Local2").GetParameter("VIN").ValueByRow( j ) )
               End If
        Next
Next
Reply
#3
Not Solved
Hi,

I downloaded your file but in my system as i don't have MS Office so not able to see the actual content. Open office is not able to recover this file.

But from the question what i understand, you are trying to run all local action rows for every Global datatable row.
Means Global datatable Row 1--Local action rows( say 1-3) will run and then it will move to next local action 2 and run all rows( say again 1-3) over there. Then when all action gets completed the the same will happen for Global datatable Row 2.And this will continue how many rows the global datatable have.
Please clarify me if i have any wrong understanding.

You can handle this situation by using the Global Iteration property from File-->Settings.( You need to make it "Run for all Rows", which is by default selected).
and for all the local actions those you want to run for all rows go to their "Call properties dialog" and in Run tab select "Run for all Rows", which is not the default case).

I think by doing this only you can meet the expectation.

Anyone please differ please let me know your view.

Thanks,
Nilanjan
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 857 04-23-2020, 07:08 PM
Last Post: BGunay
  Reading Global Sheet's DataTable Value Bhuvana 0 1,475 01-05-2020, 10:03 PM
Last Post: Bhuvana
  Error as Global Not defined while trying to retrieve value from Datatable siddharth1609 0 851 09-11-2019, 02:52 PM
Last Post: siddharth1609
  UFT Tool runs more than one iteration always cthossain 2 3,342 02-12-2017, 01:25 PM
Last Post: cthossain
  global object which can be called in any action excellentpawan123 2 2,581 04-01-2015, 07:34 PM
Last Post: babu123

Forum Jump:


Users browsing this thread: 1 Guest(s)