The ReplayHistoryCommand is used to synchronize client and server history. For example, in the context of dynamic views when multiple components are created and replaced.
If you combine the replacement or creation of dynamic components into a scripted test and then run it, the ScriptRecorder usually freezes. However , if you execute the individual ApplicationActions step by step, the ScriptRecorder works as expected.
The problem stems from rapid, repeated reloads of the page, which frequently occur in tests of dynamic views. It may happen that the page has already been reloaded after the client-side call to start the `ReplayHistoryCommand`. As a result, the `MainLayout` is rebuilt, and the “old controls” are no longer present.
This results in the CommandListener—typically the control—no longer existing when the command is executed on the server side, and thus it cannot be found. The page is then completely reloaded, and an error message stating “Target Control not found” appears. As a result, the ScriptRecorder loses its context and cannot continue with the rest of the script.
Solution
This can be prevented by declaring the command as a system command.
Test
Run a test of the dynamic views, such as TestComponentEdit.script.xml, and press the Start button on the `ScriptRecorder`. The test should run through to the end without interruption.