Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP: WebEdit : How to check if values in list are disabled.
#5
Not Solved
Anyway i tried some rough dirty code,hope some expert will you give clean solution.

Code:
txt=browser("browser").page("page").weblist("select").getroproperty("innerhtml")
arr=split(txt,"</OPTION>")
set disabled_items=createobject("system.collections.arraylist")
for each i in arr
    if instr(1,i,"disabled")<>0 then
       disabled_items.add mid(i,instr(1,i,">")+1,len(i))
        end if
next

ai=browser("browser").page("page").weblist("select").getroproperty("all items")
set all_items=createobject("system.collections.arraylist")
ar=split(ai,";")
for each i in ar
    all_items.add i
next

for each i in disabled_items
    all_items.remove (i)
next

cnt = all_items.count
randomize
myvalue = int(cnt * rnd)

browser("browser").page("page").weblist("select").select(all_items(myvalue))

set disabled_items=nothing
set all_items=nothing
Reply


Messages In This Thread
RE: QTP: WebEdit : How to check if values in list are disabled. - by rajpes - 07-27-2011, 08:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is VBScripting disabled in Office 365 update? soumyarani 0 1,290 12-19-2020, 12:37 PM
Last Post: soumyarani
Sad How To Find Dropdown Object based on Values from the dropdown list mesg2anil 12 33,047 12-19-2017, 10:25 PM
Last Post: sandy2404
  Trying to create List box in excel sheet at Run time with values yes No JACKSPARROW 0 1,606 01-17-2017, 11:05 AM
Last Post: JACKSPARROW
  Compare second web list value according to the first web list value roselin6 1 2,675 10-07-2015, 09:14 PM
Last Post: supputuri
  QTP identifying WebList as WebEdit and an Element passion77 3 8,181 01-27-2014, 10:21 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)