ruby - How to get width of an element with xpath Watir in pixels? -
ruby - How to get width of an element with xpath Watir in pixels? -
i have problem getting width of "tbody" element xpath watir. have code:
browser.element(:xpath , "//table[@onselectstart='return false']").tbody.tr(:index , 2).td.table.tbody.style "width"
this code returns me "auto", fine because attribute must set "auto" positioned on web automatically, if firebug shows me width of element. can value in pixels?
try (not tested):
browser.element(:xpath , "//table[@onselectstart='return false']").tbody.tr(:index , 2).td.table.tbody.wd.size.width
for more info see documentation element#wd, element#size , dimension#width.
ruby xpath width element watir
Comments
Post a Comment