Hello people,

Can variables be used as regular expressions in Watir?  

For example, if we want to check whether there is a link with 'href' containing 
a particular text say 'submitpage', we can say,

puts (ie.link(:href,/submitpage/).exists?)

Simiarly can we do the following.

variable_for_holding_text = 'submitpage'

puts (ie.link(:href,/variable_for_holding_text /).exists?)

In this, instead of the exact text, I have passed the variable, 
'variable_for_holding_text'.  This situation will arise when we use want to do 
such a check within an user-defined function.  

Thanks for your time,
Vijay.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to