Yeah using MVC is the right way to do it. Unfortunately that pattern is not yet fully available in this application though we are gradually refactoring our code towards that.
Meanwhile we do need to record button clicks, text typing, label clicks, slider changes etc. and then store them in some sort of text file. Later all these actions need to be played back.
Currently I am recording various actions in the event handlers like buttonClicked() or comboBoxChanged() and then playing them back. I am able to uniquely locate items through ‘paths’ that I capture when recording. I can use the paths later to locate the Component correctly.
It works in most cases for example I can simply call click() on buttons to reproduce the original click Or setText() or setSelectedItemId() for text boxes and combos.
But there are some edge cases e.g. for clicks on labels, even if I record it, playing it back by calling click() on the label component does not work: Label::click() does not generate a mouseUp() call
