Comment 4 for bug 1434434

Revision history for this message
Eugene Maslov (emaslov1) wrote :

@Raimund and Denis,

May I put some thoughts about the Recorder that I collected during the last years.
I deal mostly with GUI auto tests, where maintainability of many tests is one of the main factors, therefore I always have to store common things in common places, not in test scripts themselves.

So this is the recording scenario that I imagine.

 - The user has all his existing screenshots of buttons etc. at, e.g., "guimap.sikuli" folder.
 - If multiple image search is used, the folder contains also guimap.py file, describing the arrays of images as variables, like that:
    menu_file="menu_file.png"
    button_ok=["button_ok.png","button_ok_highlighted.png"] #(referred below as "image group")
 - The user activates the recording mode.
 - Clicks, key presses, etc. are recorded to the script as Denis already described
 - When the user clicks on some control, the Recorder:
    --Gets some area around the mouse
    --Takes, one by one, all images fom guimap.sikuli folder, and checks whether one of them exists in the area around the mouse
    --As soon as the image is found, the name of the image (or, even better, the name of variable containing this image) is put to the script, like that:
        Click(button_ok) # or Click(self.button_ok), depending on the object/non-object test structure
    --If none of the images fit, the Recorder proposes the user to crop, to name, and to add the new image to some "image group", and then stores the image at guimap.sikuli and, desirably, adds the name to guimap.py

It's much better if the Recorder takes the image not from the existing screen, which contains highlighted image, but from (or also from) the screen which existed a few seconds before, where the element was intact. For that, it's just necessary to remember a few screens for the last seconds and select the image before the last change of the screen.

To get the basis for setting spatial relations, it will be very desirable to get the screenshots not only on clicks etc., but also on mouse hovers, without clicks, inserting find() in the script. For that, the user can press some key instead of the mouse, for example, F12 or like that. With this trick, the user will be able to make an anchor, e.g. find a label to find the check box at the left of it. The sense of the anchor can be so far set manually, editing the script.

Best regards
Eugene