How to compair two object values.plz help me i write that co

How to compair two object values.plz help me i write that code but not
work properly

require 'watir'
include Watir

counter = 1

ie=Watir::IE.start("http://www.google.co.in")
file = File.new("c:/test/test.txt", "r")

while (line = file.gets '=')
      line = file.readline
                  while(counter == 1)
                         ie.text_field(:name,"userId").set(line)
                          if(ie.text_field(:name,"userId").value ==
line)
                              puts line
                              puts ie.text_field(:name,"userId").value
                              puts "Correct Value of User ID"
                          else
                               puts line
                               puts ie.text_field(:name,"userId").value
                               puts "Wrong Value of User ID"
                          end
                    break
                end
                while(counter == 2)
                          ie.text_field(:name,"password").set(line)
                          if(ie.text_field(:name,"password").value ==
line)
                              puts line
                              puts ie.text_field(:name,"password").value
                              puts "Correct Value of Password"
                          else
                              puts line
                              puts ie.text_field(:name,"password").value
                              puts"Wrong Value of Password"
                          end
                    break
                end
               counter = counter + 1
end
file.close
ie.button(:name,"Submit").click()

···

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

Zubair Ansari wrote:

                               puts line
                               puts ie.text_field(:name,"userId").value
                               puts "Wrong Value of User ID"

Change those first two to
  puts line.inspect
  puts ie.text_field(:name,"userId").value.inspect

to get a better idea of what's different. My guess is that one contains
a newline and the other doesn't; line.chomp! is your friend.

···

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

Brian Candler wrote:

Zubair Ansari wrote:

                               puts line
                               puts ie.text_field(:name,"userId").value
                               puts "Wrong Value of User ID"

Change those first two to
  puts line.inspect
  puts ie.text_field(:name,"userId").value.inspect

to get a better idea of what's different. My guess is that one contains
a newline and the other doesn't; line.chomp! is your friend.

ITs show this how to remove \n this plz help

"abcd@test.com\n"
"abcd@test.com"

···

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

********** My problem is solved ***********

Thank you............!!!!!!!!!!!!!!!!!!!!!!!!!!

···

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