Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with the function that selects multiple items
#1
Solved: 10 Years, 9 Months ago
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
Reply


Messages In This Thread
problem with the function that selects multiple items - by vijay44 - 02-05-2010, 02:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem With conversion function wajid 3 1,448 10-01-2018, 01:16 PM
Last Post: wajid
  Unable to fetch items from WpfList in UFT saurabhkumar_gupta 0 2,278 03-08-2015, 09:17 PM
Last Post: saurabhkumar_gupta
  Can't locate items on Win7 Desktop RandomGrin 0 1,978 01-30-2015, 10:55 PM
Last Post: RandomGrin
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,775 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Problem with Multiple rows retrieval from mySQL and save it some variable Dejavu 1 1,966 03-15-2013, 02:52 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)