The Javascript function does not have any access to the structure of
the page - it is a standalone interpreter which can do arithmetic and
string processing etc, but has no access to the DOM.
On 04/02/2008, Kapil Khanna Avolent <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've been tryintg to use the __javaScript() function to work with Jmeter
> for one of the AJAX call which renders the records by calling the
> javascript function which is showTreeView on the webpage.
> So for this purpose I'm trying to do the following:
>
> ${__javaScript(showTreeView("/mode/billerName/images/en/standard/schemeA
> /"\, "statementsection"\,"DGTree18"\, null),)}
>
> it doesn't work as I looked up the Jmeter.log and it shows the following
> ERROR:
>
> 2008/02/04 11:16:45 ERROR - jmeter.functions.JavaScript: Error
> processing Javascript org.mozilla.javascript.EcmaError: ReferenceError:
> "showTreeView" is not defined. (<cmd>#1)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3
> 229)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3
> 219)
> at
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:32
> 92)
> I also tried the same with __log fucntion to see how a string being
> interpreted i.e:
>
> Even when I try it using __log , it only prints the arguments of the
> function ( not sure if this is how it suppose to work):
>
> ${ __log (
> ${__javaScript(showTreeView("/mode/billerName/images/en/standard/schemeA
> /"\, "statementsection"\,"DGTree18"\, null),)} )}
>
> 2008/02/04 13:27:29 ERROR - jmeter.protocol.http.sampler.HTTPSampler:
> readResponse: java.io.IOException: Server returned HTTP response code:
> 505 for URL:
> and this prints the following in one of the argument of the HTTP request
> where I'm trying using javascript.
>
> requestType=AJAX&AJAXOpHandler=${"/mode/billerName/images/en/standard/sc
> hemeA/", "statementsection","DGTree18", null),)} )}
>
> I'm not sure whether this the correct way of calling the javascript
> function or does Jmeter support doing this or not ?
> Please provide some pointers to make this happen with JMeter.
>
> Thanks,
> Kapil
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]