Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Java Script extension tool

sendmenicedeals
sendmenicedeals Posts: 12
edited June 2020 in SOAtest

Hi,
i am new to parasoft scripting, when i am trying to create java script using extension tool using below command

<head>
  <script type="text/javascript" src="https://www.google.net?id=01&product=something"></script>
</head>

i am getting evaluate error like this :2:0 Expected an operand but found <, , ^ in at line number 2 at column number 0. i tried both option in parasoft java script (oracle nashorn) and java script (legacy).

can any one help me on this issue. thanks in advance

Comments

  • jakubiak
    jakubiak Posts: 795 admin

    You are putting HTML code into a JavaScript editor, which is why that won't work. I assume you are trying to call some code that is in the JavaScript link? If so, save that code into a local JavaScript file, and then in your Extension Tool chose the File option and select the local file. In the Method dropdown you can choose the method from the file you want the tool to call.

  • sendmenicedeals
    sendmenicedeals Posts: 12
    edited June 2020
    <head>
      <script type="text/javascript" src="https://www.google.net/bt/tags.js?id=01&product=something"></script>
    </head>
    

    thank you for your reply. yes your are right, I saved above code in the file "sample.js" and i am trying to call method dropdown as Javascript, but i am still getting the same error. Can you please help me with this. How can I save the above code and call

  • jakubiak
    jakubiak Posts: 795 admin

    You are still saving HTML contents into a JavaScript file, which you cannot do. You need to save the contents of "https://www.google.net/bt/tags.js?id=01&product=something" into the JavaScript file instead.

  • sendmenicedeals
    sendmenicedeals Posts: 12

    thank you

  • sendmenicedeals
    sendmenicedeals Posts: 12

    thank you it worked!!!