Forum Discussion

jinithlal's avatar
jinithlal
Contributor
12 years ago

getting Object while run time

Hi,



Is there any way to get the name of the object which is clicked by the user at the runtime?



In my applicatio (silverlight), I haveto perform certain actions, then user need to perform some actiona and I need to continue the run according to the user selected control. So I need to get the objects which the user selected during run time. Is there any option to do so?



Please help



Thank you

Jinith

5 Replies


  • Hi Jinith,


     


    You can use the FullName or Name property to get the name of the object you've just clicked.


     

  • Tanya,

    thank you for replying.

    but, It is not possible as the control will be clicked at runtime. my script need to wait for the action and find which control is just clicked.



    So I need to get the control name of the object while running the script



    Basically I need to record the mouse event and find which control is accessed by mouse.



    thank you
  • Tanya,



    No, user should be clicking the control. steps before and after I need to automate.



    say,

    1. series of steps should be performed by test complete

    2. Test complete waits the run for user to perform action

    3. depending on the control user selected, test complete should perform some more steps



    for step 3, I need to get which control user clicked.



    thank you

    Jinith
  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Jinith,



    Just a quick idea:

    -- Either iterate through all controls on the given form and search for the one that is focused (control.Focused = True) and assume that this is the control used by the user; or

    -- Create a User Form with the Object Picker control on it, ask a user to point to the object he/she was using and pass the selected object (or its full name) to your script.