Build Verification Error?

3 posts, 1 answers
  1. Nigel
    Nigel avatar
    53 posts
    Member since:
    Jan 2012

    Posted 19 Mar 2012 Link to this post

    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


    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'

    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?

    Nigel Edwards, Transition Computing. 
  2. Answer
    Anthony avatar
    19 posts

    Posted 20 Mar 2012 Link to this post

    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.

    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Nigel
    Nigel avatar
    53 posts
    Member since:
    Jan 2012

    Posted 20 Mar 2012 Link to this post

    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.
Back to Top