Emulating user behavior is a crucial part of energy consumption measurements.
Check out Oreoluwa Oluwasina's work (@Ore) in Season of KDE improving #KdeGuiTest, a tool for usage scenario scripting. Her work includes adding a new user interface!
*KdeGuiTest (KdeEcoTest) in SoK25: Debugging, Building an Interactive User Interface, and More*