This is a migrated thread and some comments may be shown as answers.

Build Verification Error?

2 Answers 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nigel
Top achievements
Rank 2
Nigel asked on 19 Mar 2012, 12:55 PM
Hi all,

I think I have found a logic issue with content validation, but it maybe that I'm just not understanding something, or not applying the test correctly.  Would somebody clarify this for me, please?
I have a field called 'roleCreatedOn' that contains a plain text date-time.  The HTML is:

<td id="roleCreatedOn">

19/03/2012 11:29:54

</td>


I want a test that checks that the field is not empty, so I set the Build Verification as:
    Content Verify TextContent NotContain (empty)
But when I then check that the validation is correct, Test Studio displays this:

Content.TextContent of elementdoes not match!

   Match Type: 'NotContain'
   Expected Result: ''
   Value at time of failure: '19/03/2012 11:29:54'

Parameters:
-----------
TagSegmentType  = 'TextContent'
CompareType     = 'NotContain'
ExpectedString  = Expected:[] , Actual:[19/03/2012 11:29:54]


Since the field is not empty, surely the test value returned should be true?  Why does Test Studio think the Expected Result should be ''?
Am I testing for an empty or null field correctly?

Thanks,
Nigel Edwards, Transition Computing. 

2 Answers, 1 is accepted

Sort by
0
Accepted
Anthony
Telerik team
answered on 20 Mar 2012, 04:18 PM
Hello Nigel,

This type of verification is best done in code. Instead of verifying the text content does not contain (empty), it's more reliable to verify it contains one or more characters in length. See the corresponding Code Sample Article on this topic.

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Nigel
Top achievements
Rank 2
answered on 20 Mar 2012, 05:51 PM
Thanks as ever for the feedback, Anthony.  I understand how checking for positive values is often more reliable, and I have work arounds in place to do this (even though the objective of the test is to verify that the field is unpopulated at a given point in time); however, the fact of it is that Test Studio's reported error condition is incorrect.  I think perhaps the error report message should be more accurate; and maybe you could preclude a null option when the tester is trying to write such a test in the first place.

Even so, thanks again for the promptness of your response.
Nigel.
Tags
General Discussions
Asked by
Nigel
Top achievements
Rank 2
Answers by
Anthony
Telerik team
Nigel
Top achievements
Rank 2
Share this question
or