Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

16634 Posts in 4352 Topics- by 28409 Members - Latest Member: RajSarode
 

Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: selecting multiple items from the weblist    (Read 56 times)
vijay44
User
*
Online Online

Posts: 18


« on: February 06, 2010, 02:29:47 AM »

Hi,

Application type:web
qtp version:10.

i wanted to select multiple items from the weblist.
for eg: i created a variable called n
 n=4
for i=0 to n
browser("browsername").page("pagename").weblist("operatingsystems").Extendselect"#n"
but my code is not working as expected.
i want qtp to do multiple slection till item 4.
that means i want qtp to slect item 1, item 2, item 3 and item 4
similarly if i specify n=5
it should qtp to do multipleselection till item 5.

is there any way that can be achieved.
Any help will be really appreciated.
Regards;
vijay
Logged
Asiq Ahamed
Moderator
Sr. User
*****
Offline Offline

Posts: 287



WWW
« Reply #1 on: February 06, 2010, 05:59:16 AM »

Hi Vijay,
       Try the below code,

Code
GeSHi (qtp):
strItemsCount=Browser("name:=QTP Codes").Page("title:=QTP Codes").Weblist("name:=weblist").GetROProperty("items count")-1



For i=0 to strItemsCount

        index="#"&i

Browser("name:=QTP Codes").Page("title:=QTP Codes").Weblist("name:=weblist").ExtendSelect index

Next



 
Created by GeSHI 1.0.7.20
Logged
Pages: [1]   Go Up
Print
Jump to: