Hi Wesley,

I tried the following or the text_field:

I saved the below code in a .rb file and did a require of this file in the
test script.

module Watir
  class Element
    def set_no_wait(item)
      assert_enabled
      highlight(:set)
      object = "#{self.class}.new(self, :unique_number,
#{self.unique_number})"
      @page_container.eval_in_spawned_process(object + ".set('#{item}')")
      highlight(:clear)
    end
  end

end

In the test script, I used:
@b.text_field(:id, @ssid).set_no_wait(ssid)


This did not work for the text_field onchange event.Infact it is not even
setting the text_field to the value 'item'

On Thu, May 27, 2010 at 7:16 PM, Wesley Chen <[email protected]> wrote:

> I think you can search the method as set_no_wait in Watir general group.
> Then you may have a try on it.
>
> Wesley.
> For life, the easier, the better.
>
>
> On Fri, May 28, 2010 at 7:54 AM, kashyap <[email protected]> wrote:
>
>> Thank you for posting in the link.I checked it before and I tried one
>> of the solutions and it works fine if there is a button in the form
>> that triggers the javascript validation function.
>>
>> However, in my web form, whenever i enter some data in the text_field,
>> the onchange event gets called, this triggers the alert box.I cannot
>> use click_no_wait as it is not a button that I am clicking.
>> I am actually setting some value to a test_field like this:
>>
>> $ie.text_field(:id, @ssid).set(ssid)
>>
>> Whenever, this statement gets executed, the ssid text_field gets
>> filled with the value that is stored in ssid string and immediately
>> the onchange event gets triggered like this:
>>
>> <INPUT class="longbox" id="WlanEssid" maxLength="32"
>> onchange="IsSsidValid( this )" name="WlanEssid" value="MedNet.WPAPSK" /
>> >
>>
>> the javascript function IsSsidValid(this) actually does the validation
>> of the ssid text_field and displays an alert box with a corresponding
>> error message if there is an invalid entry.
>>
>> I want to actually get handle of this alert box and access the text in
>> it to cross check it.So is there a way that I can access the text of
>> that javacript pop-up?
>>
>>
>>
>> On May 27, 1:19 pm, Željko Filipin <[email protected]>
>> wrote:
>> > On Thu, May 27, 2010 at 10:13 PM, Adam Reed <[email protected]>
>> wrote:
>> > > Exactly what I came to post; You're too fast Željko!
>> >
>> > The fastest gun in the West! :)
>> >
>> > Željko
>>
>> --
>> Before posting, please read http://watir.com/support. In short: search
>> before you ask, be nice.
>>
>> You received this message because you are subscribed to
>> http://groups.google.com/group/watir-general
>> To post: [email protected]
>> To unsubscribe: 
>> [email protected]<watir-general%[email protected]>
>>
>
>  --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: [email protected]
> To unsubscribe: 
> [email protected]<watir-general%[email protected]>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to