Micro Focus QTP (UFT) Forums
problem with the function that selects multiple items - 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: problem with the function that selects multiple items (/Thread-problem-with-the-function-that-selects-multiple-items)



problem with the function that selects multiple items - vijay44 - 02-05-2010

Hi,
I have written a function, which has parameters weblistname and value in the weblist.
It works for every item in the weblist.
I want to do multiple select what i am doing is

Code:
Call TypetoWebList("operatingSystems", "mac")
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^{DOWN}"
Call TypetoWebList("operatingSystems", "Windows")
WshShell.SendKeys "^{UP}"
    Set WshShell = Nothing
i want to press ctrl+down and ctrl+up
manually i can do by pressing shift key and selecting items.
my code is selecting individual items in the weblist.
i want to select multiple items.
Below is the code i have written
Public Function TypetoWebList(WebList_Name, strTypeinWebList)

Set WbList = Description.Create()
WbList("micclass").Value = "WebList"
WbList("name").Value = WebList_Name
Dim objAllWbList
Set objAllWbList = Browser("micclass:=Browser").Page("micclass:=Page").ChildObjects(WbList)
        AllWbList_Cnt = objAllWbList.Count
for i = 0 TO AllWbList_Cnt-1
                WbList_Name = objAllWbList(i).GetROProperty("name")

                If Trim(WbList_Name) = Trim(WebList_Name) Then
                        Dim strWbListOption, arrWbListOption
                        strWbListOption = objAllWbList(i).GetROProperty("all items")
                        arrWbListOption = Split(strWbListOption, ";")

                        For j = LBound(arrWbListOption) to UBound(arrWbListOption)
                                Print arrWbListOption(j)
                                
                                If  Trim(strTypeinWebList) = Trim(arrWbListOption(j))Then
                                        objAllWbList(i).Click
                                        objAllWbList(i).Select arrWbListOption(j)

                                        Exit Function
                                End If
                        Next
                        
                    Exit For
                End If
        Next

    End Function



RE: problem with the function that selects multiple items - Saket - 02-05-2010

hey Vijay44,
it seems all the threads below are related to the same issue.
Problem in selecting multiple items in the weblist
problem in wrting function
problem in implementing the keyboard inputs
right?
why are you creating multiple threads instead discussing it in the same?
why dont you try the solution provided there in other post?
do you need to test Ctrl up/down is working or not or you just need to select the multiple items?


RE: problem with the function that selects multiple items - vijay44 - 02-06-2010

Hi,
I am extremely sorry for opening multiple threads of the same issue, i will make sure that, i will not open multiple threads of the same issue.
Regards;
Vijay