- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-05-2018 08:43 AM
I am having a problem with ATF, the Field Values Validation setting is passing successfully even though the value in the record is different to the filed being tested. Here is the validation test.
When I run my test it suceeds.
But this is not what was set on the record. Here' part of the screen shot that ATF records. You will see that the contact type is actually set to 'Direct Input'. See below.
Does anyone have any clue to what may be going on?
Thanks in advance,
Arthur
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2018 04:06 AM
Hi Mark,
Further work (and help from a fresh pair of eyes from one of my colleagues!) revealed the solution and it was simple in the end. The problem was due to using 'Field Values Validation' rather than 'Record Validation'. Once the newly created record is opened, the requirement was to validate that new record hence the need for record validation rather than field validation.
The solution is as follows:
1. Set the 'Field Values Validation' step Active = False, or alternatively delete it completely, but I left it in for the screen shot.
2. Add extra step 'Record Validation' to the Test.
With the above change made the validation works as expected.
Best regards,
Arthur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-05-2018 08:58 AM
Contact type should be a choice field but your screenshot makes it look like it's a string field. Do you have more than one field named contact type? Are you 100% sure that you're dealing with the same table and the same field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-08-2018 05:28 AM
Hi Mark,
Thanks for responding. Due to the size of the screenshot I included it was misleading. Sorry about that! Here is a better copy of the file; you'll see the contact type shows the drop down and there is no other field on the form called 'Contact type'. So I believe I am validating the correct field.
However this field is below the fold so it doesn't appear in the screen shots produced by ATF so I have modified ATF to raise a record producer in my name 'Arthur Ansell' and then changed the validation to check for a colleagues name instead of mine. I would expect the test to fail, but it still passes? Here is my setup:
1. The ATF 'Set Variable Values'
2. My record producer has the following script line that passes the variable
current.requested_for = producer.snow_requested_for
3. Here is the screenshot output created by ATF, showing my name as the 'Requested for'.
4. Here is my validation - deliberately checking the wrong name.
5. So as before i would expect the validation to fail? But it passes with the output below:
So is it possible to explain this?
Thanks,
Arthur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-08-2018 05:46 AM
Can you share a screenshot of the previous test steps? Also, what version of ServiceNow are you running in this instance? If you give me the basic steps I can try to reproduce in my instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-08-2018 06:13 AM