You can access that element in one of the two ways that @jeff-price pointed out, or you could extend watir to add support for the tag.
This is not included by default since that stuff is not part of the HTML5 standard proper. With what essentially amount to 'custom' tags like this there are of course an unlimited number of potential custom tags. it is impossible to add support for all of them.
OTOH it is very easy for you to include a small snippet of code in your project that would add support for the tag to watir, which if you know your project is using it a lot, makes perfect sense.
# extend watir to allow support for custom elements not expressly defined in HTML spec
module Watir
module Container
def g(*args)
G.new(self, extract_selector(args).merge(:tag_name => "g"))
end
def gs(*args)
GCollection.new(self, extract_selector(args).merge(:tag_name => "g"))
end
end
class G < Element
end
class GCollection < ElementCollection
def element_class
G
end
end
end
depending on what framework etc you are using, you can either put that into a file and require the file early in your test code, or put it into a file in a directory that is automatically loaded..
e.g. I use Cucumber, so I created a file named custom_element_support.rb with that code in it and put it into the features/support directory where cucumber will automagically load it as it starts up