The following approach is not specific to single test automation tools but applies for most tools in the market like CBTA, eCATT and HP QTP/ HP UFT.
Typical situation when working with dynamic screens
Some transactions like ME51N Create Purchase Requisition remember the state from the last usage of the transaction in the user context. So the start screen in the transaction can have collapsed screen elements
or the screen elements could be expanded
You perform a recording for an automated test while all required screen elements are already expanded. When you execute the test script later it might fail because some of the required screen elements can’t be processed as they are not visible. This could happen if same user left the transaction during the last usage in a different state or you are executing the script with a different user or even in a different system.
You perform the recording when the required screen element is initially not visible so you record the click on the button that expands it. When you replay the script most likely fails because the initial screen state is now expanded and the related button was replaced by the collapse button (e.g. ME51N).
- Check which screen elements are required and get a clear picture of the initial screen state that is required to perform the actual test activities.
- Check for shortcuts to prepare the screen to always get to the right state (e.g. to expand the required screen elements). Most times you’ll find the shortcuts with mouse over text for the button (with ME51N) or context menu of right mouse click (ME21N)
Shortcuts (e.g. Crtl+F2 and Crtl+F3) should be processed although the necessary screen elements are already expanded to ensure these actions are part of the script.
The recorded script will always ensure that the screen is prepared to meet the expected state and then is able to perform the actual test activities independent from last usage or user context.