Regular VS Simulated Clicks

Tuesday, September 04, 2012 by Stoil Stoichev | Comments 2

Test Studio's clicking and typing steps come in two varieties: regular and simulated clicks. You can flip between the two by going into the Properties menu for the respective step:

A regular (non-simulated) click/typing is an action that is injected directly into the DOM of the page. This has advantages - it's faster and more reliable. It will work even if you run the test on a locked desktop. But it's fundamentally different from a real user clicking/typing on a control.
And the disadvantage is that it will not trigger any events that are associated with the control in question. 

Often you will have a javascript function that is triggered by a specific event (OnMouseOver, OnKeyPress etc). on a specific control. Generally, a non-simulated click will not trigger such an event. Consequently the javascript function will not be fired off and some action that you're expecting within your application will not occur. You can try it out your self on the following sample page. The onkeydown event is a pretty typical example of this problem.

So there you have it: whenever your click/typing steps don't seem to be doing what they're supposed to do - try flipping them to SimulateRealClick=true. It will help a lot of the time.

About the author

Stoil Stoichev

Stoil Stoychev

has been helping customers solve their complex testing challenges leveraging his in-depth knowledge of Telerik Test Studio. He has traveled the globe fine-tuning his technical expertise and helping our valued clients succeed. In his spare time he enjoys motorcycles, live music and various sports.

2  comments

  • JP 04 Sep 2012
    That is really interesting, thank you. Currently we are not using Test Studio (yet), just the Testing Framework, and we are sometimes having problems because the clientside events aren't triggered. Does the Testing Framework have support for this as well? Does the SimulatedClick also trigger events that were hooked up by jQuery, e.g. by using the .live() or .on() functions?
  • Nitin 05 Sep 2012
    In case of Silverlight Button,

    How Simulate Real User Click Property we set to False as IN Properties windows this Property is missing for Silverlight Button

     

    public ArtOfTest.WebAii.Silverlight.UI.Button LaunchOrganizationDialogButton

    {

     

    get

    {

     

    return Get<ArtOfTest.WebAii.Silverlight.UI.Button>("AutomationId=LaunchOrganizationDialog", "XamlTag=button");

    }

    }


Add comment

  1. Formatting options
       
      
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)