class Watir::IE # monkey-patch Watir's IE class
  def element *args
    arg1, arg2 = args # this is needed so hashes would work as input
    elements =
[ :table, :link, :cell, :image,:checkbox, :radio, :text_field, :select_list, 
:button]
# Watir elements which
    elements.each do |el| # iterate over each element
      element = self.send(el, arg1, arg2)
      return element if element.exists? # return element if it exists
    end
    nil # return nil if element was not found
  end
end

def Method_GetItemListCount(properties)
ie = Method_GetParentHandle(properties); #Get the Parent Handle
objHandle=Method_GetObject(properties); #Get the Element identified on
combination of property string passed
obj=eval(objHandle); #Get the Object Reference
obj1=obj.getAllContents;
opvar=obj1.length
return opvar
end

def Method_GetItemList(properties)
ie = Method_GetParentHandle(properties); #Get the Parent Handle
objHandle=Method_GetObject(properties); #Get the Element identified on
combination of property string passed
obj=eval(objHandle); #Get the Object Reference
opvar=obj.getAllContents;
return opvar
end

def Method_SelectMultipleItemList(properties,strr)
ie = Method_GetParentHandle(properties); #Get the Parent Handle
objHandle=Method_GetObject(properties); #Get the Element identified on
combination of property string passed
obj=eval(objHandle); #Get the Object Reference
prop_type=strr.split('|')
noOfProperty=prop_type.length
for i in 0..noOfProperty-1 do
obj.set(prop_type[i])
end
opvar=true
return opvar
end

def Method_ClickLink(properties)
  ie = Method_GetParentHandle(properties); #Get the Parent Handle
  objHandle=Method_GetObject(properties); #Get the Element identified
on combination of property string passed
  obj=eval(objHandle); #Get the Object Reference
  obj.click();
  opvar=true
  return opvar
end

The above code identifies a dropdown list as a check box when the
method's related dropdown lists are appeared
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to