Forum Discussion

alesaux's avatar
alesaux
Occasional Contributor
6 years ago

Test if Text Field is Empty

Hi,

 

We are trying to perform actions on a text field based on its content, particularly if it is empty.

At this point we have tried Checkpoints and Compare Properties with various options configured, and even if/then statements but none of these accept the parameter Field.wText equals "".

 

We have also tried using "undefined" and "null" and the simple quotes.

 

We are running out of ideas at this point as TestComplete simply states that whatever we put in is not an acceptable value.

 

Details about the field tested:

 

WndClass: WindowsForms10.RichEdit20W.app.0.ab933b_r6_ad1

ClrClassName: AYTRichTextBox

ClrFullClassName: Keyoti.RapidSpell.AYTRichTextBox

 

Same issue occurs on another text field with the following details:

 

WndClass: WindowsForms10.STATIC.app.0.ab933b_r6_ad1

ClrFullClassName: System.Windows.Forms.Label

 

Important information we are not using Script, only Keyword Tests.

 

Anyone has any idea how to verify that the text field has nothing in it?

 

Thanks,

Auriane

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Let's see the actual error that TestComplete is giving and also a screenshot of the object spy results for one of those fields.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    alesaux wrote:

     

    We are running out of ideas at this point as TestComplete simply states that whatever we put in is not an acceptable value.

     

     

     


    This is an interesting statement...  Can you give a screenshot or screenshots of the steps you are going through to create the checkpoint or if-then logic? It sounds like you're entering something into a field that is not expected... like putting a code expression into a field for an onscreen object... or something like that.  

  • alesaux's avatar
    alesaux
    Occasional Contributor

    Hi,

     

    Thank you for your replies. So weirdly today we have not been able to reproduce the issue. We started from scratch since posting (created a new keyword test item, re-recorded and tested if the field is blank in multiple ways) and it now works as expected.

     

    I think we must have done what you suggested and tried to compare incompatible object types? Not sure.

     

    Will update this thread should this reoccur as we are having a lot of odd test results with our application due to the Object being partially unsupported (DotNetBar items and the lot).

     

    Thanks!