Forum Discussion

Satheesh-raju's avatar
Satheesh-raju
Occasional Contributor
3 months ago

JavaScript validations added are failing with 200 response code

Hi,

All the JavaScript validations in the test steps are failing with the error - "invalid syntax, or an error occurred during the run." during the execution where the response code displays as 200 in the test results.

The JavaScript validations are working without any issues when the script is played back without any load applied.

Any pointers to understand the issue?

 

2 Replies

  • mickhence's avatar
    mickhence
    New Contributor

    JavaScript validations failing with a 200 response code typically indicate that the server-side validation is not being triggered or is not properly configured. Check your server-side code to ensure it's properly handling the validation logic and returning the appropriate response codes.

  • Humashankar's avatar
    Humashankar
    Champion Level 0

    Hi Satheesh-raju 

    That's a great clue!

    The JavaScript validations are working without any issues when the script is played back without any load applied.

    Given that the JavaScript validations work perfectly when played back without load, it's likely that the issue is related to the load testing environment or the way the load is being applied.

    LoadNinja might be using a different JavaScript engine or version than the one used during playback without load. Confirm that the load testing tool's JavaScript engine is compatible with your script

    LoadNinja might be using browser emulation to simulate user interactions.

    Hope this helps - Happy to help further!!
    Thank you very much and have a great one!

    Warm regards