how do simply activate this javascript....from watir

8 views
Skip to first unread message

dave

unread,
May 25, 2010, 3:11:10 PM5/25/10
to Watir General
...javascript:MM_goToSubframe('MAINIFRAME','../work/SSRECV?
USER_FUNCTION_NAME=SSRECV') Quick Store-to-Store Transfer

Željko Filipin

unread,
May 26, 2010, 4:36:57 AM5/26/10
to watir-...@googlegroups.com
On Tue, May 25, 2010 at 9:11 PM, dave <BITD...@yahoo.com> wrote:
> ...javascript:MM_goToSubframe('MAINIFRAME','../work/SSRECV?
> USER_FUNCTION_NAME=SSRECV')      Quick Store-to-Store Transfer

Please post more code. In my experience, you probably just have to fire an JS event, something like this:

browser.element(how, what).fire_event "onclick"

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them
vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi

joedio

unread,
May 26, 2010, 10:22:54 AM5/26/10
to Watir General
Dave,

You need to determine what user interaction activates the java script.
Is it when the user clicks on some HTML element,( a link, a button,
etc), is it when the user enters text in a field, or whatever?

Once you know that key piece of information examine the HTML code for
that element to see what fire event is causing the java script to be
invoked. Then use Watir's fire_event method to simulate that action.

For example the HTML link below would activate a java script function
named "popup()" when the user hovers the mouse over that link. So it
would require Watir to send a fire_event of "onmouseover"

<a href="#" onmouseover="popup()" >Hover to open a popup</a>


Joe

Reply all
Reply to author
Forward
0 new messages