View previous topic :: View next topic |
Author |
Message |
berimu
Joined: 11 Feb 2005 Posts: 6 Location: Netherlands
|
Posted: Tue Feb 07, 2006 2:13 am Post subject: wildcards and macros |
|
|
I want to check a file, that is created once a week, if there is a certain string in it.
The file name is YYYYMMDD_HHMMSS.log Using a wildcard. But this does not seem to work.
To check the file I use %YYYYMMDD%_*.log
Is there a different way? Or do I do thing wrong?
Ivo |
|
Back to top |
|
|
Yoorix
Joined: 14 Dec 2005 Posts: 177
|
Posted: Tue Feb 07, 2006 8:58 am Post subject: |
|
|
You have written macros correctly. It should works.
Are you sure you have checked checkbox "Use date macros" followed by filename input box?
Do you provide file location path correctly?
Regards,
Yoorix |
|
Back to top |
|
|
Yoorix
Joined: 14 Dec 2005 Posts: 177
|
Posted: Tue Feb 07, 2006 9:03 am Post subject: |
|
|
O-o! Sorry! I pressed Sumbit button too early
Try to remove "_" from filename. It should helps.
Try use %YYYYMMDD%*.log instead of %YYYYMMDD%_*.log
Regards,
Yoorix |
|
Back to top |
|
|
berimu
Joined: 11 Feb 2005 Posts: 6 Location: Netherlands
|
Posted: Tue Feb 07, 2006 9:35 am Post subject: |
|
|
Sorry too,
Every week a system automatically updates and writes a log file. It starts aon monday 12:00 o'clock and end at a certain time . The date is known but not the endtime. So I use the Test method "compare" "File contains " and the translate macros checked for the string FAILURE.
I hope to check if somewhere in the file I see a Failure.
For example in the file 20060201_132218.log
I check on \\servername\d$\Data\applicationname\Logs\%yyyymmdd%_*.log |
|
Back to top |
|
|
Yoorix
Joined: 14 Dec 2005 Posts: 177
|
Posted: Tue Feb 07, 2006 9:43 am Post subject: |
|
|
As I wrote above,
could you apply that string:
\\servername\d$\Data\applicationname\Logs\%yyyymmdd%*.log ,
without "_".
I think in this case character "_" is processed incorrectly.
Regards,
Yoorix |
|
Back to top |
|
|
Yoorix
Joined: 14 Dec 2005 Posts: 177
|
Posted: Tue Feb 07, 2006 9:47 am Post subject: |
|
|
Why don't you use "Text log" test method instead of "Compare Files"?
I think you should use "Text log" in your case.
Regards,
Yoorix |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12808 Location: USA
|
Posted: Tue Feb 07, 2006 1:09 pm Post subject: |
|
|
"Compare Files" test method does not support wildcards.
"Text Log" test method is not appropriate in such case because application creates log file at once, it does not add records one by one during the week. Right?
Solution? H'm.. How do you start that application? Can you use some BAT file to start the application and rename log file when application terminates?
Regards
Alex |
|
Back to top |
|
|
Yoorix
Joined: 14 Dec 2005 Posts: 177
|
Posted: Tue Feb 07, 2006 2:23 pm Post subject: |
|
|
[quote="KS-Soft"]"Text Log" test method is not appropriate in such case because application creates log file at once, it does not add records one by one during the week. Right?[/quote]
I've understood, that application creates log file once a week by pattern YYYYMMDD_HHMMSS.log and problem is to check matching to this pattern, isn't it? In this case, I think, 'Text log' test gets better.
Regards,
Yoorix |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12808 Location: USA
|
Posted: Tue Feb 07, 2006 2:31 pm Post subject: |
|
|
"Text Log" test method checks for NEW records in the file that already EXISTS
Regards
Alex |
|
Back to top |
|
|
berimu
Joined: 11 Feb 2005 Posts: 6 Location: Netherlands
|
Posted: Fri Feb 10, 2006 9:42 am Post subject: |
|
|
Did some testing and....... "Text log" is not usable.
But the "Compare" does seem to work using the %YYYYMMDD%*.log notation.
I created a testfile that gave a error when string "Failure" was found and no error when the string was not found. (So far so good.
HOWEVER When I created an error I received reply: Cannot open file \\servername\d$\Data\Logs\20060210*.log |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12808 Location: USA
|
Posted: Fri Feb 10, 2006 10:41 am Post subject: |
|
|
Compare Files test method does not support wildcards
Regards
Alex |
|
Back to top |
|
|
berimu
Joined: 11 Feb 2005 Posts: 6 Location: Netherlands
|
Posted: Mon Feb 13, 2006 3:56 am Post subject: |
|
|
Anyway.
Using the wildcard it does seem to work and finds the correct file. Alas I indeed get the error message.
I also will try to change the logfile name.
Thank Ivo |
|
Back to top |
|
|
|