Micro Focus QTP (UFT) Forums
Compare second web list value according to the first web list value - 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: Compare second web list value according to the first web list value (/Thread-Compare-second-web-list-value-according-to-the-first-web-list-value)



Compare second web list value according to the first web list value - roselin6 - 10-06-2015

Hi,

Can someone please give a solution for the below scenario

Web list 1
Web list 2
If we select item from web list 1, web list 2 values changes accordingly. Need to validate the listed items in web list 2.


RE: Compare second web list value according to the first web list value - supputuri - 10-07-2015

Find the below snippet to give a quick idea how to handle this scenario.
Code:
WL1Selection = DataTable("List1")
Print "WL1- " & WL1Selection
Print "--------------------------"
For iWL2ListItem = 1 To DataTable.GetRowCount
       DataTable.SetCurrentRow iWL2ListItem
    WL2ListItme = DataTable(WL1Selection)
    If WL2ListItme <>"" Then
        Print WL2ListItme
    End If
Next
Global Data Table:

Code:
List1 | AA  | BB  | CC  |
-------------------------
AA    | 1   |  4  |  7  |
-------------------------
BB    | 2   | 5   |  8  |
-------------------------
CC    |  3  |     |  9  |
-------------------------

OutPut:-
Code:
WL1- AA
--------------------------
A
B
C
WL1- BB
--------------------------
D
E
WL1- CC
--------------------------
G
H
I