Forum Discussion

omerj28's avatar
omerj28
Occasional Contributor
14 years ago

Required Filed Validation

I have a web application and on one of the pages,  I need to verifiy that validation bubbles do show up if the user clicks the Save Buttton without entering a value in the required fields on this page. How can I make TestComplete verify that the validation bubble does appear in the given scenario?



The steps involved are as follows:

1-Navigate to the desired page.

2-Click the Save button without entering any values in the required fields.



Both the required fields are highlighted red and a validation bubble appears next to the fiedls when click in the fields,, tab into them.

4 Replies

  • Hi Omer,


    The specific code you need to use depends on the way the pop-up is implemented. The general approach is to use one of the Wait* methods (e.g. WaitPanel or WaitAliasChild) to wait for the needed object to appear or, if the object always exists and only the object's visibility is changed, wait for the property value to be changed. Please see the Waiting for a Process or Window Activation and Waiting for an Object to Have a Specific Property Value help topics for more information.


    To get the object you need to wait for, use the "Point to the object" mode instead of the Finder tool to capture the object in question (see the Object Spy Window help topic for more information)

  • omerj28's avatar
    omerj28
    Occasional Contributor
    Here are the steps and the login validation that i want to verify:



    1-I want to verify that when I click the Login button without entering a User ID and Password, both the User ID and Password fields display a label underneath them with a certain text.

    2-By entering an invalid User ID and a correct password and clicking the Login button i want to verify that a certain message is displayed on the web page below the page title.

    3-By entering an invalid Password and a correct User ID and clicking the Login button i want to verify that a certain message is displayed on the web page below the page title.




  • omerj28's avatar
    omerj28
    Occasional Contributor
    Here are the steps and the login validation that i want to verify:



    1-I want to verify that when I click the Login button without entering a User ID and Password, both the User ID and Password fields display a label underneath them with a certain text.

    2-By entering an invalid User ID and a correct password and clicking the Login button i want to verify that a certain message is displayed on the web page below the page title.

    3-By entering an invalid Password and a correct User ID and clicking the Login button i want to verify that a certain message is displayed on the web page below the page title.




  • Hi Omer,


    I recommend that you map the objects to make TestComplete recognize them via custom criteria (for example, native ID or message text, see the Mapping Web Page Elements help topic for more information) and use the WaitAliasChild method to wait for an object to appear. If the objects always exist and only their visibility is changed, I recommend that you use the approach described in the Waiting for an Object to Have a Specific Property Value help topic.