Forum Discussion
Hi,
> how TestComplete is interpreting the HTML
HTML markup has only one attribute (named 'disabled', https://www.w3schools.com/tags/tag_button.asp) that makes native HTML button to be enabled or disabled.
All other fancy dances with classes (class="ui-button-disabled...) are specific to this or that jscript library and are interpreted exclusively according to the implementation of the library. For example, nothing prevents library to define a class named ui-button-disabled and make a browser to display the UI element with this class applied as, say, enabled option button with some background image.
The core of your problem is that the state of the button is controlled by some jscript that analyses the state of the field (at least) and enables the button when the field contains some data and disables the button when the field is empty. Usually, such scripts are triggered by the events like keypresses or when control loses focus. Note, that script can be bound to the events that are triggered in response to explicit user's actions. For example, the event may be triggered in response to keypress, but be not triggered when the value of the field changes. This was the reason why I suggested to replace .SetText() method with the .Keys() one.
One more idea that you may try is to execute .Keys("[Tab]") after entering the value into the field. This will emulate as if the user pressed Tab key to move input focus to some other UI control from the current input field.
Also, you may try to execute .Keys("[Enter]") to emulate Enter press after data entry. This also may update some internal field's structures and trigger a change event. However, this also may trigger some default action. Tab is more safe in this sense, but you may try.
If nothing from above helps, I think that you should talk with developers and ask them what triggers the script that controls the state of the button and what end-user must do to trigger this event. Then you will emulate user's actions using .Keys() method.
As workaround.
Try to run some JavaScript code to set disable property = false before you proceed to send keys.
https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/javascript.html