I got it.

 if message.index("*") != nil
   myvar = message[0,message.index("*")].to_s
   regxmyvar = Regexp.new myvar
   puts $ie.div(:text,regxmyvar)
 end

It failed if If my string end with '('  so I'm guessing special
characters have to be substituted.




On Jan 21, 11:37 am, Moochie <[email protected]> wrote:
> I have a message that appears with a different number at the end,
>
> (*) wild cards - where the number would be
> Message = You have successfully saved the new screening data. (ID =
> ***)
>
> #Check to see if * (wild card exist)
> if message.index("*") != nil
>       #Formats string to ignore wild card text and anything after
> that.
>       message = message[0,message.index("*")]
>       #Try to find the message using formated - Fails here
>       puts $ie.div(:text,eval("/"+message+"/"))
> end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to