TestProject Forum
Powered by leading experts in the test automation community

How to use String utils or Number utils to trim money with $ char

Hi team,
I get a text from table cell (e.g 1,795.00) and I would like to trim special chars (such as " ", “,” and “number after .”) to fill it in a search box (the result should be 1795).
I’m trying to use String utils or Number Utils but it seems doesn’t work after installed these addons because I can’t find them in actions.
Anyone can help with this case? (I’m newbie and want to practice testproject now).

Thanks

Hello @chuchuynh and thanks for reaching out.

Have you tried ‘Add step manually’? These actions are not element actions, and won’t appear in the context menu when using the recorder spy to view an element.

See following images:

1 Like

Hi David,
Thanks for pointing this out. I found them.
Regards,

1 Like

Hello again,

How can I replace/ trim chars in a text using these utils?

Example:

1

Thanks.

Hello @chuchuynh,
you can use the “get substring in range” with the following inputs.

1 Like

It works for me. Thanks a lot.
One more item, how about the dynamic range. I mean I want to get the number between dollar char and “.”
1
Thanks

As I said above. I’m newbie so there are many things I need to learn about this tool. Please help when you have a chance. Thanks

Hello @chuchuynh
You can use the Replace substring method.
The input will be the string with the $ character.
The output will be the string without.
The target will be ‘dollar sign’ and the replacement just keep empty.

For example:
image

1 Like