Hi Zeljko,

 

Thanks for your great help, it work perfectly!

 

Ban

 

Ps. I will buy you a beer if you have a chance to come to California…

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zeljko Filipin
Sent: Tuesday, September 12, 2006 5:10 AM
To: [email protected]
Subject: Re: [Wtr-general] click the button in form

 

Hi Ban,

I will tell you how I solved your problem.

I made a html file that contained the smallest amount of html code that I thought would be enough to reproduce your problem. Here it is:

<input type=submit value=":: Login &gt;">

Then, i opened irb and tried to reproduce your error.

C:\Documents and Settings\zfilipin\Desktop>irb
irb(main):001:0> require 'watir'
=> true
irb(main):002:0> ie = Watir:: IE.attach(:title, //)
=> #<Watir::IE:0x2e54690 [...removed some text...]>
irb(main):003:0> ie.button(:value, ":: Login &gt;").click
Watir::Exception::UnknownObjectException: Unable to locate object, using value and :: Login &gt;
[...the rest of error message...]

Then, I did some investigation.

irb(main):004:0> ie.button(:index, 1).value
=> ":: Login >"

So, for watir value of that button is ":: Login >" and not ":: Login &gt;" as it is in html file. That is because "&gt;" represents ">" character in html files (to avoid confusion, because all tags end with ">").

Then I tried to flash that button.

irb(main):006:0* ie.button(:value, ":: Login >").flash
=> nil

(It flashed).

Then I tried to click it.

irb(main):007:0> ie.button(:value, ":: Login >").click
=> ""

Success! :)

Zeljko

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to