Forum Discussion

nebti_nassim's avatar
nebti_nassim
Occasional Contributor
10 years ago

Save button stay disabled after the form has been filled


Hi everyone, 



I got an issue with TC that I don't understand. I'm working on a C++ application and in this application we got a toolbar with a save button that stay disabled until we fill all the mandatory field of a form. 

When I fill those fieds manually the button change its state to enable, but when I pass by Testcomplete and fill the field with it, the button stay disable. Further, if I decide during the test to add a letter to the content of the last field to be filled, the button is activated.



My button is in a toolbar and declared like an item of this toolbar and not a child, In this case, I can't go through to see the inner properties of my button.

If you know why the event that enable my button is not triggered when I use testcompletes, please let me know.



I stay disponible for more infos



Thanks and sorry for the bad english,


  • Hi Nebti,



    If your test populates fields via the .SetText() method, you may try to replace it with the call to the .Keys() method for the last field or for all of them. (According to your message, it might be enough to use .Keys() for the last mandatory field.)
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Nebti,



    If your test populates fields via the .SetText() method, you may try to replace it with the call to the .Keys() method for the last field or for all of them. (According to your message, it might be enough to use .Keys() for the last mandatory field.)
  • gnaneshwar_cse5's avatar
    gnaneshwar_cse5
    Occasional Contributor
    Hi,



    For this problem you can use the tab function before click on the save button.





    1.enter text filed



    2.enter tab from that text filed.



    3.Next Click on save button.











  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    > I guess I will use exclusively this method for now :)

    This might depend on the tested application...

    In general, .SetText() method works faster, especially, for the web-based applications. However, .SetText() does not trigger internal methods of the tested application that are triggered when the user presses keys on the keyboard. (Usually, this happens for the custom, in-house controls that do not implement complete and extensive support for the control contents change events.) And the fact, that these methods are not triggered, might result in the behaviour that had been observed.
  • nebti_nassim's avatar
    nebti_nassim
    Occasional Contributor
    Thanks Reddy, Alexei,



    Using the Keys() method instead of setText() did the job, I guess I will use exclusively this method for now :)
  • nebti_nassim's avatar
    nebti_nassim
    Occasional Contributor
    Thanks for the clarification, I guess that I will now use the setText() method on my field and keep using Keys() method on the last field that need to be filled.



    Thanks alot for the help,