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

Popular posts from this blog

java - Bypassing "final local variable defined in an enclosing type" -

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -