Forum Discussion
Well SetText() should trigger the OnChange javascript event in that version of TestComplete, I believe it was added in 11.31. From the SetText docs:
The SetText action does not activate the application window that contains the control, though it moves the insertion point to the beginning of the control’s text. Unlike the wText (for edit controls) and the wText (for combo box controls) properties, SetText fails when it is applied to a disabled or read-only control.
The SetText action works differently for web and desktop objects. For test objects in desktop applications, the action raises only text change events and does not raise keystroke events. For test objects on web pages, the action fires the onchange event (a “text change” event), and “keystroke” events like keyup, input and keydown that may trigger keyboard-related scripts (for example, autocompletion popups). Anyway, if the expected event does not occur, try using the Keys action.
So as you can see the SetText method should fire any of the normal keyboard events. Do you know which specific event needs to be triggered in your application? If it's not one of the ones listed above then you'll have to use the Keys() method. Otherwise you might want to consider opening a support ticket with SmartBear, they added support for triggering these events with SetText very recently so there might just be a bug that needs to be fixed.
Following events are used in my application.
focus, blur (leave), change
SetText method support these events?
- ghuff29 years agoContributor
It should trigger the onchange event if that's what you meant by change. Doesn't sound like it supports the other ones from what the documentation says. You'll have to use the Keys() method to trigger those events.
- RajTC9 years agoOccasional Contributor
Thanks Robert and ghuff2.
Thanks for responding to my message.