Ask a Question

Test if Text Field is Empty

Occasional Contributor

Test if Text Field is Empty



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:



ClrClassName: AYTRichTextBox

ClrFullClassName: Keyoti.RapidSpell.AYTRichTextBox


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



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?




Community Hero

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

[Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
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.  

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Occasional Contributor



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).



Showing results for 
Search instead for 
Did you mean: