0

Does anyone know if there is a way to uses variables in a calabash touch/query/etc function?

For example, say I have a variable called hotel_name and I wanted to touch("* marked:#{hotel_name}") and use that in a test step like:

Given(/I select "(.*?)"$/) |hotel_name|

touch("* marked:#{hotel_name}") end

it is not working for me. So can someone tell me if this can be done and how?

Thanks

1 Answers1

1

There are missing apostrophes in your query and do in your block :) Proper code should look like that:

Given(/^I select "(.*?)"$/) do |hotel_name|
  touch("* marked:'#{hotel_name}'")
end

I think it should help :)

kjuri
  • 158
  • 1
  • 10
  • Awesome! I believe this was so simple that i over thought the solution and never considered trying that! SMH!! #newbieBlues – Jason Corbett Dec 25 '14 at 02:29