This is the common misunderstanding concerning scriptStep. scriptStep allow you to use different language to script WebTest and htmlunit, NOT (or at least not directly) to run javascript code in the context of your html page.

Marc.

Chang Su wrote:
Hi,

I am trying to use javascript in <scriptSteps> as
follows,

        <scriptStep language="javascript">
          var my_var ="hello world";
          document.write(my_var);
        </scriptStep>


Exception raised:
com.canoo.webtest.engine.StepExecutionException: Error
invoking script: org.mozilla.javascript.EcmaError:
TypeError: Cannot find function write., Step:
ScriptStep at
/usr/webtest/MyTests/simple1/SimpleHTTPS_3X.xml:95: with (language="javascript", script="
          var my_var ="hello world";
          document.write(my_var);


why it is complaining about document.write(), is that
a standard method already included in js*.jar as part
of webtest??


need help here!!

thanks a lot,

Chang


____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html _______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest


_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to