I'm pretty new to Watir.
I was looking for a way to detect the type of object received by a subroutine, in order to apply the correct method. The final result should be something like:
sub clickOnElement (elementId, elementRef)
element= browser.(elementId.to_sym, elementRef)
case TypeOfElement (element)
:link element.click
:radio element.set
:checkbox element.set
:list ....
end
end
My question is about the actual implementation of TypeOfElement().
Any suggestion or pointer is appreciated: thank you in advance
Sergio