|
View previous topic :: View next topic |
Author |
Message |
cichockia
Joined: 19 Sep 2014 Posts: 36
|
Posted: Tue Nov 05, 2019 2:34 am Post subject: View with new tests from last few days |
|
|
Hello,
How to create a view that shows tests that have been added in the last 7 days
I used the "using expression" option:
('% CreatedTime%' getword 1)> = '% fvar_date_7_days_ago%'
"fvar_date_7_days_ago" - calculated date today minus 7 days in the format "yyyy-mm-dd"
Unfortunately, the view also shows tests from 7 days ago.
Where is the mistake, any ideas
Thank you in advance for your help |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Nov 05, 2019 3:09 am Post subject: |
|
|
There is extra space chars after %, better remove it
'% CreatedTime%'
'% fvar_date_7_days_ago
Such expression will be compared as 2 strings so result depends on Windows regional settings.
E.g.
yyyy/mm/dd: ('2019/10/20' >= '2019/10/13) will be compared as you need
dd/mm/yyyy: ('20/10/2019' >= '13/10/2019) will not works in the way you need because string like '20/10/2015' > 13/10/2019
Regards
Alex |
|
Back to top |
|
|
cichockia
Joined: 19 Sep 2014 Posts: 36
|
Posted: Tue Nov 05, 2019 4:43 am Post subject: |
|
|
Hello,
Special characters added during copying, they are not present in the configuration, the condition looks like this:
('%CreatedTime%' getword 1) >= '%fvar_date_7_days_ago%'
The local date format is YYYY-MM-DD, so it seems that the comparison should work as expected, unfortunately it doesn't work.
I did the ping test and entered in the "Tune up Replay value" field:
('%CreatedTime%' getword 1) - '%fvar_date_7_days_ago%'
The result in the Reply field is:
('2019-11-05 11:30:17' getword 1) - '2019-10-29'
It seems that it should be OK and not a view still returns tests added a few years ago.
The cause was determined, it is about the scope of variables.
The condition works incorrectly for tests that are located in directories with "Use folder variables only"
So my variable %fvar_date_7_days_ago% needs to be mapped to global |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Nov 05, 2019 12:09 pm Post subject: |
|
|
Quote: | The condition works incorrectly for tests that are located in directories with "Use folder variables only" |
Do you mean you have some sub-folders that do not inherit variables from parent and you did not specify variable for these sub-folders?
Then expression works correctly, because any date string starts with number, '0'>'%' so any_date>unresolved_variable, result=True, test fits expression
Regards
Alex |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|