Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disabled items in a JavaList ()
#1
Solved: 11 Years, 3 Months, 4 Weeks ago Shy 
I am doing automation on a Java Application, which has combo box and in which few items are disabled but when I try to retrieve values from it , it takes all of them including the ones which are disabled.

How cal I eliminate disabled items for Java List .
Please Help!
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Code:
'Below code works in my weblist, similarly try for your java list.

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

for each i in all_items
    msgbox i
next

set disabled_items=nothing
set all_items=nothing
Note: There could be better solution for this!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  object disabled eliass 1 1,712 05-30-2017, 02:28 AM
Last Post: Vichu M J
  [UFT] [WPF] DataGrid: get items of ControlTemplate robertosalemi 0 3,484 07-14-2016, 07:52 PM
Last Post: robertosalemi
  How to set a value if webEdit control is disabled? rohit.kum.02@gmail.com 1 3,538 12-30-2015, 12:25 PM
Last Post: vinod123
  SwfList: unchecked all items robertosalemi 0 1,952 12-21-2015, 03:46 PM
Last Post: robertosalemi
  Select Menu items shilpaS 1 7,073 06-19-2015, 01:23 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)