on(AccountSelect) do |page|
@account_number = page.data_for(:customer)
account = @account_number['account'].to_s
@four = account.split(//).last(4).join
end
#on(AccountSelect).span_element.click
@browser.span(:text => "*"+"#{@four}").when_present.click
I take the account number in my dataMagic yml and just take the last 4 digits of the account. I take the last 4 digits and search for a span that has the text that includes the 4 digits. I want to Click that span. I tried the commented out step trying to do span_element.click but that just times out. So I just manually put the step in using watir. The watir step actually does pass but on the web page, the row doesn't become highlighted like it should. The span is part of a table row, thinking I'm not approaching this correctly because it's a table element?