Micro Focus QTP (UFT) Forums
Problem in selecting multiple items in the weblist - 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 in selecting multiple items in the weblist (/Thread-Problem-in-selecting-multiple-items-in-the-weblist)



Problem in selecting multiple items in the weblist - vijay44 - 02-04-2010

Hi,
I have a weblist, i need to select multiple items in the weblist.
Manually i can do in the application by pressing shift key.

i am using the below code
Code:
Set WshShell = CreateObject("WScript.Shell")
        oPage.WebList("name:=operatingSystems").Click
        WshShell.SendKeys "{SHIFT}"
Browser("browser").page("page").WebList("name:=operatingSystems").Select datatable.Value("OperatingSystems",oSheetName)
    set WshShell = Nothing
The above code does not work. it does not select multiple items.
The datasheet column:operating system has values
windows and imac.

but the above code selects only windows, how to select multiple items.
Any help will be really appreciated.
Regards;
vijay


RE: Problem in selecting multiple items in the weblist - Saket - 02-05-2010

is this the same issue in your earlier thread?

use 'ExtendSelect' method of weblist to select multiple items.

@Everyone - Please use proper formatting while posting. use tags to wrap your codes which makes it more readable.


RE: Problem in selecting multiple items in the weblist - piyush5@qtp - 07-28-2011

Hi Sanket,

Instead of weblist i had a webtable under which i have to select multiple webelement.Manually i am able to do it by pressing Control key+mouse click.But unable to perform the action with the help of QTP as extend select doesnt work for webtable.Kindly Guide.


RE: Problem in selecting multiple items in the weblist - gaveyom - 08-09-2011

Hi,

Code:
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 1
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 2
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 3

this is the way you can select multiple options in List by using
--- ExtendSelect ---


RE: Problem in selecting multiple items in the weblist - sshukla12 - 08-09-2011

U can use select for the first case followed by extend select for the remaining extra selection of the objects.


Code:
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").Select 1
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 2
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 3

Correct me if wrong

Regards,
Sankalp


RE: Problem in selecting multiple items in the weblist - gaveyom - 08-10-2011

Hi sshukla,

what ever u said above is correct and it wont be problem even if u use ExtendSelect

both the ways are correct

Code:
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 1
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 2
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 3
or

Code:
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").Select 1
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 2
Browser("Home").Page("Home").Frame("I1").WebList("lbSelColumns").ExtendSelect 3


Regards,
Gaveyom


RE: Problem in selecting multiple items in the weblist - sshukla12 - 08-10-2011

Ya its correct. it will work fine in both the ways.
But using select first followed by extend select is a better programing approach.

Correct me if wrong.

Regards,
Sankalp


RE: Problem in selecting multiple items in the weblist - gaveyom - 08-10-2011

yes