SimulateRealTyping functionality

2 posts, 0 answers
  1. Yan Jun
    Yan Jun avatar
    36 posts
    Member since:
    Jan 2019

    Posted 22 Sep 2019 Link to this post


    I would like to ask about the feature SimulateRealTyping. I have used it in some of my test cases and i found out that there is some effect when I'm not using it and when i am using it. When i am not using it, while executing the scripts, the auto-fill function in my application under test did not worked and it works after i use the Simulate Real Typing function.

    1. May I know when and what kind of scenario should I use this function? What is your recommendation? 

    2. And If I were to use this function, what is the impact and risk of using it ? Such as maybe it will affect execution time and etc. ?

    Hoping to hear from you soon.

    Thank you.


  2. Daniel Djambov
    Daniel Djambov avatar
    87 posts

    Posted 23 Sep 2019 Link to this post

    Hi Yan Jun,

    Thank you for contacting us on that matter.

    I will explain you a little more what SimulateRealTyping is doing and give some answers and suggestions to your questions, so you can make decisions when to use it or not for your application.

    Some web applications use controls that invoke scripts once user clicks on them or starts typing with keyboard. Those scripts can trigger auto-complete for example or change some other control (becoming active or appearing if not visible), depending on how your application is developed. When running automation tests, by default Click steps and Type steps perform very fast by finding the control type and sending it command to fill the text or act like click, without triggering Keyboard or Mouse actions. This works in most cases, but when the web control has some event/script attached to it, which can be triggered only by Keyboard or Mouse action, then SimulateRealType or SimulateRealClick step property should be used. What is does if find the control by its find expression, get its coordinates and then perform Desktop commands like Desktop Click and Desktop Type in it. That way it simulates real user interaction and triggers scripts on page that are required to access specific application functions. Here is a small blog post on this matter.

    To summarize and back to your questions:

    1. Use SimulateRealType or SimulateRealClick actions in cases some specific scripts need to be invoked when entering text or clicking on item in your application. It all depends on how your application is written, so it is case specific and you have to find where you need it, once the normal behavior fails, try to use this Simulate... property and see if this solves the problem for click and type steps.

    2. There is no specific impact of using it, however there might be some unexpected behaviors observed: these steps will not work if you don't have Active User Session (windows session is locked), but it is a rare requirement to run tests without user session; as the actions themselves move mouse over the coordinates of the control and perform Windows Desktop operations on those coordinates, it might happen that some dialog or other windows is over the web control to perform actions against and the Real Type/Click step will report as passed, while it might not do what you expect - this is again application specific behavior; As per execution time, using Real Type steps slows down the specific step execution time, but the difference is so small that it does not affect overall test execution time at the end.

    To summarize: my recommendation is to use RealType and RealClick steps only in specific cases in your automation scenarios, when it is needed and you will find the cases by debugging your automation tests while building and stabilizing them.

    Hope the above information will be helpful for you to start using these specific step properties. If you need further assistance or more guidance, please let us know.

    Best Regards,
    Daniel Djambov
    Progress Telerik

    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top