1

I got in my site several amounts of money displayed like this: $5,000 I want to sum all of them and to check some variables. How can I parse and get the number 5000 and use it as a number (summing up, multiplying etc) using Selenium IDE?

1 Answer 1

1

You can use storeEval and parse the string into the Number using javascript:

<tr>
    <td>storeEval</td>
    <td>Number('$5,000'.replace(/[^0-9\.]+/g,""));</td>
    <td>amount</td>
</tr>
<tr>
    <td>echo</td>
    <td>${amount}</td>
    <td></td>
</tr>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.