I did not read your code well.
But, Browser location form can exec javascript.
So I think can exec as like a "ie.link(:url, "your-javascript").click."

I think Ray ways also possible.
and if exec that way.

ie.execute_script "your-javascript"
ie.link(:url,ie.window.Result).click

------------------------------
module Watir
def execute_script(scriptCode)
      WIN32OLE.codepage = WIN32OLE::CP_UTF8
       window.execScript(scriptCode)
 end

def window
       WIN32OLE.codepage = WIN32OLE::CP_UTF8
       ie.Document.parentWindow
 end
----------------------------
WIN32OLE.codepage was needed for me,Coz our application use UTF-8
no need it normal western encoded pages.I guess.

Hope it help.
tknv/




On Wed, Jul 8, 2009 at 12:35 AM, Ray<rayjh...@gmail.com> wrote:
>
> The way that i exceute Java script is:
>
>  browser.document.parentWindow.execScript(scriptToBeExceuted)
>
> This seems to work in internet explorer only, fire fox says browser
> does not have a property documnet.
>
> Hope this Helps
>
> Ray
>
>
>
> On Jul 6, 10:33 pm, Pallavi Sharma <write2pall...@gmail.com> wrote:
>> Anyone out there can you please help with this??
>>
>> ---------- Forwarded message ----------
>> From: Pallavi <write2pall...@gmail.com>
>> Date: Sat, Jul 4, 2009 at 7:08 PM
>> Subject: Exceute Java Script
>> To: Watir General <watir-general@googlegroups.com>
>>
>> Hi All
>>
>> I am not able to execute java script in below lines of code...
>>
>> "<select name="MIR-CVG-STBL-1-CD" onChange="onChangeTerm('MIR-CVG-
>> STBL-1-CD','MIR-CVG-MAT-XPRY-DUR')" onfocus="enterField(this)"
>> size="1" stype="Selection">"
>>
>> I have used this method    -> "execute_script(source) "  buts its
>> showing error
>> Error in method  ->  "undefined method `execute_script' for
>> #<Watir::Frame:0x31ef908> (NoMethodError)"
>>
>> require 'Watir'
>> ie=Watir::IE.attach(:title,//)
>> ie.frame(:index,2).frame(:id,'ContentFrame').select_list(:name,'MIR-
>> CVG-STBL-1-CD').select "11 Years"
>> ##source= onChange="onChangeTerm('MIR-CVG-STBL-1-CD','MIR-CVG-MAT-XPRY-
>> DUR')"
>> source="onChangeTerm('MIR-CVG-STBL-1-CD','MIR-CVG-MAT-XPRY-DUR')"
>> ie.execute_script(source)
>>
>> Kindy let me know..
>> Thanks in advance...  :)
>>
>> Pallavi Sharma
>>
>> --
>> Thanks & Regards,
>> Pallavi Sharma
>>
>> CresTech Software Systems Pvt. Ltd.
>> Your Testing Partner
>> Testing Services | Consulting | Resourcing | Trainings
>> Tel: 0120-4160873|0120-2632223
>> Mobile No:  +91-9971022177 |www.crestech.in
>> HP Mercury Gold Partner | IBM Business partnerwww.QACampus.comYour One Stop 
>> Testing Portal !
>>  Before printing, think about the environment.
>>
>>
> >
>



-- 
tknv/

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