cucumber - Get the text of a link within a table cell -


i have table similar one:

<table id="space-list" class="aui list-container">     <tr class="space-list-item" data-spacekey="blankspaceexample">         <td class="entity-attribute space-name">             <a title="blank space example" href="https://q-leap.atlassian.net/wiki/display/blankspaceexample/blank+space+example+home">                 blank space example             </a>         </td>         <td class="entity-attribute space-desc">             <span>                 example of "knowledge base" type space, freely editable, accessible everyone, may deleted @ time.             </span>         </td>     </tr> </table> 

my pageobject code looks this

class space < pageobject::elements::tablerow   def name     cell_element(index: 0).link_element(href: /q-leap/).text   end    def description     cell_element(index: 1).text   end end pageobject.register_widget :space, space, :tr  class spacedirectorypage   include pageobject    spaces(:space)     table_element(:id => 'space-list')         .group_elements(:tag_name => 'tr')[1..-1]   end end 

and iterating on rows in table content of each cell:

while true   on(spacedirectorypage).space_elements.each_with_index |space|     puts space.name     puts space.description   end end 

which working fine description, have no clue how access text of link within first column; tried 100s of things, nothing worked.

thanks in advance!


Comments