Forum Discussion
Thank You... this simple modification worked.
Great, thank you for the update.
P.S. Change Tools | Options | Engines | Recording | Record text input into simple editors as option to 'Keys' to prevent this problem with future recordings.
- Colin_McCrae8 years agoCommunity Hero
If you are wondering WHY it worked .....
It's because "SetText" effectively just assigns a value to the field. This is NOT the same as someone entering a value. When you use "Keys" instead, this mimics the user actually typing. Which, in turn, will activate event triggers. The event trigger in your case being the enabling of the next field.
Although the docs suggest this should not be the case on web apps, which yours is: https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/edit/settext-action-edit-control.html
... I still prefer to always use "Keys" as it's the closest to actual user behaviour.
- AlexKaras8 years agoChampion Level 3
Hi,
> It's because "SetText" effectively just assigns a value to the field.
To be even more precise... It was stated for TestComplete 11.3 that SetText also fires the keydown, input and keyup events for web pages. However, I saw that a lot of 'modern and popular' web frameworks bound their jscript code to the events like OnKeyPress, OnKeyUp, etc. and it is my understanding that some of these events are not triggered when keydown, input and keyup events are fired.
- Colin_McCrae8 years agoCommunity Hero
I've certainly seen plenty instances where SetText triggers nothing. Despite the docs saying it should.
But I have yet to run into an instance where Keys has not worked 100% correctly. So I presume their implementations are still different enough that Keys remains the most reliable, and closest to actual user behaviour, of the two?
For me, it's simple best practice. I just don't use SetText. Full stop. :smileyhappy:
Related Content
- 2 years ago
- 10 years ago
- 4 years ago
Recent Discussions
- 16 hours ago
- 17 hours ago
- 4 days ago