I've also tried to ignore the <BR> by using Regexp and wildcards

#Excel Value
123 fake street*
Crookston, MN 56716

#I'm trying to replace * in excel with a wild card to ingnore the <BR>
tag 
regxmyvar = Regexp.new text.gsub("*","/\.*/") - Does this look correct? 

puts regxmyvar

<?-mix:123 fake street\/.*
Crookston, MN 56716)

#This still didn't work.
if $ie.p(:text=>/#{regxmyvar}/,:index=>1).exists?      
        puts "MIH3"
end



-----Original Message-----
From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of Moochie
Sent: Wednesday, March 04, 2009 8:30 AM
To: Watir General
Subject: [wtr-general] Comparing Tag Text when a <BR> Exists


html
<P>
   #text   - 123 fake street
   <BR>
   #text - Crookston, MN 56716

>From Excell
text = 123 fake street
          Crookston, MN 56716

$ie.p(:text=>text,:index=>index).exists?
  puts "Pass"
else
  puts "Failed"  - Makes it here.
end

So I had the function insert the text into excel using: to see what
the text actually looks like with <BR> tages
ts_worksheet.range($results+$ts_row_nbr.to_s).Value =$ie.p
(:index=>1).text

It displayed the text Like
123 Fake Street 
Crookston, MN 56716 

If I copy that excel cell to the required cell the excel spread sheet
and run the test again it will pass.

The squares in the above were created using Expanded Ascii, but they
don't work when I manually add them in excel cell, so tell the maual
testers to use that when they see a <BR> take will not work.

Does anyone know a way to handle this?

I was thinking maybe using wild cards excel
123 Fake Street*
Crookston, MN 56716*

So everytime I see a * i use .gsub('*',/\.*/) but this will doesn't
work because I cannot convert a regular expression into a string.

Or I could create a function that formats the text to look like.
$ie.p(:text=>/\123 Fake Street/.*/Crookston, MN
56716,:index=>index).exists?

Can anyone help with a soluction to this?

Thanks,

Darin











--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to