Forum Discussion

Sariali's avatar
Sariali
Contributor
13 years ago

Generating test-data during test-recording


hello!



we are working with a timeline. it has a lot of objects (sound, picture, text).

every move of these objects with the mouse changes the internal data-structure.





to create for each combination of mouse-operations i need a lot of single recordings -

checking out manually the internal data-structure. 





my idea is: 

instead of figure out the internal data-structure for every single move on the timeline,

i would prefere that: do a lot of movements on the timeline in one recording-session and save automatically 

the internal data-structur on mouse-button-up-event in a unique-name file. these stored data-structures are used later to compare with.





is there a possiblity to catch the mouse-button-up-event during recording a test?









example like this:





#preparation

tc_recorder.OnMouseUpEvent := myMouseUpEvent;





procedure myMouseUpEvent;

begin

sys.myprocess.SaveInternalData; // 

end;





#recording

-- record started!

   -- on MouseUp myMouseUpEvent called!





sincerly

necip sariali

4 Replies

  • Hi,


    As far as I understand, the object hierarchy in your application changes after each movement. That is, a specific tested object belongs to different parent objects at different moments in time. So, to run your test successfully, you need to replace the old object name with a new one before running the test.


    To solve this problem, I recommend that you use the Name Mapping feature. For example, you can move the needed object up the hierarchy to a stable parent object, and then use the Extended Find setting to identify this object. For more information, please read Using Extended Search Criteria for Mapped Object Identification.


    Could you please answer what you actually try to do by comparing the data structures stored after each movement?


  • at first, thank you, Margret, for the speedy response

    and second : excuse me for my awful grammer.





    i don't mean the objects of the vcl.





    let me simply say

    you have an array of 5 integers (1,2,3,4,5)

    you draw this integers on a canvas.

    you can move this integers with the mouse

    every movement changes the order of the numbers

    there are a lot of possiblities to move between these numbers





    i would like do this:

    start recording

    start:

    - move a number with the mouse (-> button down)

    - when i release the mouse-button (-> mouse up) i would like to save the current array of integers (e.g. 5,2,3,4,1)

    - goto start: (until i stop recording)





    now i have a script x (tc)

    and a file y with following content:

    5,2,3,4,1

    5,3,2,4,1

    2,5,2,4,1

    etc.





    when i start the automated test (script x)

    tc would exactly move the numbers as i have did

    and i could compare on each mouse-up

    with the next numberes in the file y.


  • Hi,


    To simulate moving an object with the mouse, you can use the Drag action in your tests.


    After the action is called, you can save the application object structure and properties to an Objects collection item. For this purpose, use the Objects.Save method.


    To compare the stored structures, you can use the object checkpoints.

  • thank you, Margarete, this was the right answer for another question! :-D



    i'll now do this:

    modify my test-appl and add a button to my form.

    after each operation

    i'll press the button and save my current internal data-structure into a file



    after recording i have to modify my tc-script

    now: not to press this additional button

    but instead peek the result out of the file

    to compare with the current internal-data.











    #file closed.