ruby capybara - get xpath at runtime -
how can retrieve xpath through code?
example have below html code:
<div class="row"> <label class="stronglabel col-sm-3">plan type:</label> <label class="stronglabel col-sm-3">plan subtype:</label> <label class="stronglabel col-sm-3">erisa:</label> <label class="stronglabel col-sm-3">tpa name:</label> </div>
i wanted xpath, thing below:
table_results = page.find('#plan type:')[:xpath]
see - http://www.rubydoc.info/gems/capybara/capybara/node/element#path-instance_method
page.find('#plan type:').path
note -- copied find not valid finding in html posted. if wanted find xpath label text 'plan type:' like
page.find('label', text: 'plan type:').path
Comments
Post a Comment