Thank you, Rich. What you propose has no difference with ie.link( :text, /vb/ ).click As I wrote, it works. Unfortunately, I cannot use it. I develop a function that has a parameter var. It takes the text that goes into regular expression. This is equivalent to var = "vb" ie.link( :text, /"#{var}"/ ).click
The link is dynamic. It can be contain "vb" today and "bv" tomorrow. The question is how to use the variable content in the regex? Regards, Vladimir On Mar 23, 6:58 pm, Rich Downie <richdow...@gmail.com> wrote: > try this; > var = /vb/ > ie.link(:text, var).click > > On Mon, Mar 23, 2009 at 9:46 PM, vladimir...@hotmail.com < > > > > > > vladimir...@hotmail.com> wrote: > > > I have a link with the following text: vb (User-44, vb:DocuShare)CPX. > > > It works when I use the statement: > > ie.link( :text, /vb/ ).click > > > But for the following code: > > var = "vb" > > ie.link( :text, /"#{var}"/ ).click > > > it gives me the message Unable to locate element, using :text, /"vb"/. > > May be it treats vb in regex as "vb". > > > Please, help. > > Thanks, > > Vladimir > > --http://www.visualcv.com/richdownie- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---