ReadyAPI- append date in a filename
Hi all,
I would like to fetch a file from my harddrive but each time I do so the DateTime should be appended after the filename and before the extension of the file.
how could I do that please?
What I have so far (but it doesn't work)
// get document from path and append with DateTime
def path = testRunner.testCase.testSuite.project.getPropertyValue("pathDir")
def getFile = new File(path + "\\CheatSheetGitBash.html")
log.info getFile
def date = new Date().format('yyMMddhhmm')
log.info date
//add a timestamp to the file
def readName = getFile.getName()
log.info readName
def fileDate = readName + "${date}" as String
log.info fileDate
Output:
Thu Aug 12 18:18:32 CEST 2021: INFO: CheatSheetGitBash.html2108120625
Of course this is not what I'm expecting. Expected output should be:
CheatSheetGitBash210812T1823.html (or something like that)
Thanks in advance.
AAB
Hi!
The roadmap portal can be found here: Welcome - Zephyr Scale | Product Roadmap (productboard.com)
I've listed some thoughts on both approaches. Given the choice I would go with multiple test cycles as for me it offers the best reporting options and the least risk of 'user error'.
Multiple test cycles:
- It's quick and easy to clone test cycles
- Having multiple test cycles makes reporting and dashboarding clean and easy
- You can use the Test Cycle homepage to view both cycles next to each other for an overview of testing progress
- If you change the test cycles' underlying test cases, you may need to update multiple test cases in multiple test cycles (there is a request to have an 'update all' feature on the roadmap you can vote for 🙂)
Multiple executions:
- It's quick and easy to start a new execution and change the environment
- Reporting and dashboarding is a little more involved (filter by environment)
- Testers may forget to change the environment and skew your reporting
- There's no immediate overview reporting against both environments in the Test Cycle homepage to understand progress (whereas with multiple test cycles that image is clear).
Hope that helps.