Using executeJavaScript()

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Using executeJavaScript()

Tony Sterrett

I'm trying to execute a piece of JavaScript using executeJavaScript() As i understand it
the function executeJavaScript()  allows you to execute a function within a HTML page.

   function TermsAccepted() {

function ShowSalesInfo(dt) { $('#divSaleInfo').show(); }
Java code that calls function TermsAccepted

            String javaScriptCode = "TermsAccepted";
            ScriptResult result = htmlPage.executeJavaScript(javaScriptCode);
            System.out.println("functin result:  "  + result.getNewPage());            
The result is:

function result:  HtmlPage(

I was hoping to see a new page with Sales Info

Thanks is Advance

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Htmlunit-user mailing list
[hidden email]