TestProject Forum
Powered by leading experts in the test automation community

How to output the result of javascript?

Hello All,

Just want to ask if how do to save the result of executed javascript?
2019-10-31_00-05-47

Hi @quality.1dayQA,

To save the output of this action, click on “Select parameter” in the step definition.

Kind regards,
Amit

Hello Amit I already tried that one(see screenshot but the output for the script is not save)

Hi @quality.1dayQA,

I want to summarize our conversation in the chat for users who will find this post in the future :slight_smile:

Your scenario was: getting text that contains both digits and numbers and you wanted to remove the non-numeric characters so that you can later perform mathematical expressions on those numbers.

Instead of removing the non-numeric characters using the JavaScript command, I suggested to use this addon: https://app.testproject.io/#/addons/community?a=GeAOQXvdY0CkfHDs9c_yHA

Another option, is to use this addon to manipulate the string with regular expression or finding a substring: https://app.testproject.io/#/addons/community?a=D5P7e9ZMO0aPwXNrWJE9iA

You approved that my solution worked for you.

Kind regards,
Amit