Forum Discussion

AAB's avatar
AAB
Regular Contributor
4 years ago
Solved

ReadyAPI- Regex - delete numbers doesn't work

Hi all,

 

In my previous post I was looking for a way to run all teststeps with a code that adds a dateTime.

 

This ticket is to ask how to use Regex in ReadyAPI as this code isn't working:

 

 

 

filenameWithoutExtension.replaceAll("^[\\d]+", "")

 

 

 

So with this regex I want to ask the code to delete all numbers in the name of "filenameWithoutExtension" and replace it with something empty. That "something empty" is something I found on the internet, but I don't think actually that I would need that...right?

But nevertheless, it doesn't work.

 

Can someone help me with this please? or find another way to delete the date that is already present?

I've tried to find a regex with the help of this site:  https://regex101.com/

but that doesn't work neither. Maybe I'm using it wrongly. And of course looked on Stack overflow and a bunch of other forums but none of the description they gave can make ReadyAPI happy.

 

Thanks in advance,

AAB

  • Hi,

     

    I don't know about JUnit reporting with ReadyAPI, but your general requirements:-

    - Report results for every loop in test

    - Don't stop when a test fails.  Continue to the end and let me see what had failed.

     

    Report results for every loop in test : In my data loops, I use a Datasink step to record the test and result as a single row in a text file.  After the test, I import this text file (it's a CSV) into Excel where I have my nicely formatted result sheets.

     

    Don't stop when a test fails.  I'm assuming you're using assertions.  In my opinion these are great in tests, but less so in data-driven (data loop) tests.  Instead of assertions, I use a Groovy script which compares the actual result from the service with the expected in my datasource and write the result in the datasink step.

     

    Have a look at this similar question:- https://community.smartbear.com/t5/ReadyAPI-Questions/How-to-get-pass-fail-status-of-groovy-scripting-in-excel-sheet/m-p/222998#M54602