From: Mike B. <mb...@Ga...> - 2003-09-15 00:38:18
|
Pg wrote: > I'm trying to "simulate" a navigation over a Html page. So, if an > element in the page has an associated event (like onmouseover), I want > to run the Javascript code associated (if exists) with this event. > I tried using the Htmlpage.executeJavaScriptIfPossible method in this > way: > > Htmlpage.executeJavaScriptIfPossible( javascript_code, message, false, > null) > > Here is the code: > > ScriptResult sr = > page.executeJavaScriptIfPossible("document.Form1.Input1.value = > 'go!';", "error in go!", false, null); > > The problem is that the new page I obtained in the ScriptResult Object > returned by the the previous operation doesn't differ at all from the > original page, when I was expecting a different value in the > Form1.Input1.value attribute: 'go!'. This operation doesn´t throw any > exception, it just pass..... but there`s no differences!!. The page returned in the ScriptResult will only be different if a new page was loaded as a result of executing the javascript. In this case, no new page will be loaded so the same page should be returned. I don't see anything wrong with the code you have provided - I would have expected this to work. Can you provide a more complete sample? -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |