Thanks, I figure out a way to handle it using.
current.attributes.each do |atr| Darin On Feb 11, 11:51 am, Paul Rogers <paul.rog...@shaw.ca> wrote: > this pagehttp://msdn.microsoft.com/en-ca/library/ms533055(VS.85).aspx > > shows there are several different properties 'type' which probably > apply to different types of elements. > > Im guessing that maybe a link as the focus when you run this code and > type does not apply to links, hence the error > > Paul > > > > On Wed, Feb 11, 2009 at 10:14 AM, Moochie <dduph...@redbrickhealth.com> wrote: > > > def get_active_Element() > > active_element = "" > > current = $ie.document.activeElement > > props = ['id','name','value'] > > props.each do |prop| > > p = current.invoke(prop) > > if current.invoke(prop) != nil > > case current.invoke("type") #Error Here > > when "text" > > active_element = $ie.text_field(prop.to_sym,current.invoke > > (prop)) > > end > > break > > end > > end > > return active_element > > end > > > Goal, I'm attempting at get the activeElement and displaying it. > > > I'm getting unknow property or method 'type' HRESULT error code > > > It appears that there isn't a activeElement on the page or one that I > > cannot invoke type. If I put the focus on the text field this passes > > with no issues. > > > How do I know what I can & can't invoke? > > > Thanks,- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---