Forum Discussion

ralyn_sg's avatar
ralyn_sg
Contributor
10 years ago
Solved

"Unable to perform the action because control is disabled" error coming up

Hi ,



While automating using keyword scripts I have a form in which I have to enter data .On entering valid data only does the "Save" button get enabled. During playback the data gets entered in the form but after this I am getting the "Unable to perform the action because control is disabled".Any thoughts?
  • If the form uses keystrokes to enable the save button, you might need to change the inputs from SetText to Keys for methods to set the text. Doing it this way will allow the save button to be enabled by firing the Keys event in code.



    If its just a delay that is required, you could add a WaitProperty("Enabled", true, 5000) to wait for the button to be enabled before proceeding or failing after 5 seconds if the button is not enabled.

3 Replies

  • If the form uses keystrokes to enable the save button, you might need to change the inputs from SetText to Keys for methods to set the text. Doing it this way will allow the save button to be enabled by firing the Keys event in code.



    If its just a delay that is required, you could add a WaitProperty("Enabled", true, 5000) to wait for the button to be enabled before proceeding or failing after 5 seconds if the button is not enabled.
  • NisHera's avatar
    NisHera
    Valued Contributor
    To add to Todd's reply in some scenarios setText may not work

    If so , use Key method.
  • Thanks.When I gave a delay the test worked like a charm. :)