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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -