Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
program for sorting
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
I have to check whether the items in a listbox is in sorted order or not..can anyone please write the VB code for me..the items consist alphabets and numbers..its sorting on the basis of ascii values..
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Have you tried this by yourself? If yes, post the tried code then members here can help.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Aparna, this is a simple function that will retrieve all values from a list object and enumerate them in QTP's print log:

Code:
Public Function getListValues(strWebListDesc,creationT)

    strBrowser = "creationtime:=" & creationT
    strPage = "micclass:=Page"

    Count = Browser(strBrowser).Page(strPage).WebList(strWebListDesc).GetROProperty ("items count")

    iCount = 1
        
    Do while iCount < Count    
        Browser(strBrowser).Page(strPage).WebList(strWebListDesc).Select "#" & iCount
        sListVal = Browser(strBrowser).Page(strPage).WebList(strWebListDesc).GetROProperty ("selection")
        Print sListVal 'Temporary placeholder
        iCount = iCount + 1    
    Loop    
    
End Function

Usage: Call TestWebListValue("name:=loc","")

You can test this exact code here: https://www.google.com/accounts/NewAccou...1cb&type=2
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sorting alphabetically rachnamalik 2 7,224 11-08-2014, 12:31 AM
Last Post: rachnamalik
  Error in getting sum of numbers program QTpier 2 3,121 07-18-2014, 01:53 PM
Last Post: QTpier
  "How to write Batch Script runner program" suresz449 2 4,022 12-19-2011, 05:15 PM
Last Post: Munna.Sarfraz
  "VBScript Program" suresz449 0 2,762 12-19-2011, 09:55 AM
Last Post: suresz449
  Write a program to Capture Desktop Screen shot kumarmoyilla 2 11,780 07-11-2011, 10:51 AM
Last Post: souvikghosh_diatm

Forum Jump:


Users browsing this thread: 1 Guest(s)