#passing value instead of constant

search=“id”
name=“text1”
browser.text_field(search, name).flash #is not working, ERROR:invalid
attribute: “id”

but
browser.text_field(:id, name).flash #working

I want something like the first one where I’ll pass a string “id” or
class. Isn’t it possible?

On 08/28/2012 06:53 PM, ajay paswan wrote:

Is this some kind of rails voodoo? What happens if you switch it to;

search=“id”
name=“text1”
browser.text_field(search.to_sym, name).flash

Sam

In the first example you’re using a string, in the second a symbol.

2012/8/28, ajay paswan [email protected]:


Posted via http://www.ruby-forum.com/.


Wysłane z mojego urządzenia przenośnego

– Matma R.