7 Answers, 1 is accepted
Thank you for contacting Telerik Support.
In order to achieve this, you have to use the test step property SimulateRealTyping or SimulateRealUser (if you are working with Silverlight). These properties determine whether the existing text will be replaced by the newly entered text.
Looking forward to hearing from you.
Regards,
Velin Koychev
Telerik
Actually, for Silverlight applications you have to make sure that SimulateRealUser is set to False for the typing test step. By default it is set to True.
If this doesn't help, we will need more details about that in order to come to the root of the issue:
1. Please provide us with a copy of your test and if it is possible grant us access to your application so we can reproduce the issue on our end and give you a solution.
If direct access is not possible, capture a Fiddler trace and attach it to this support ticket in a zip file. If you are unfamiliar with how to do so, this link will provide you with step-by-step instructions for download and use. Please make sure to enable 'Decrypt HTTPS traffic' and 'Store binaries' options (see attached image) before starting capture.
2. Please record a Jing video demonstrating the entire process, so we can better understand what is happening.
Looking forward to hearing from you.
Velin Koychev
Telerik
1. Convert the recorded Type step to a coded step (if this is not already done)
2. Replace the line of code created by Test Studio to do the typing (usually a call to SetText method on the element object) with a call to the following API.
ArtOfTest.WebAii.Controls.Xaml.XamlControlHelper.SetText
(FrameworkElement xamlControl, bool simulateRealUser, string text, int keyPressTime, int keyHoldTime, bool fireKeyEvents = false, bool clearCurrentText = true);Pass in true for simulateRealUser (second parameter), false for clearCurrentText and appropriate values (per your test needs) for the other parameters as shown below.
TextBox textBox = Pages.xxxxx.SilverlightApp.TxtFragmentTextbox;// Replace this with the text box object used by your test.
ArtOfTest.WebAii.Controls.Xaml.XamlControlHelper.SetText(textBox, true, inputtext, 10, 100, true, false);
You may need to add appropriate references to your project and using statements in the code-behind file to get the above code to build.
NOTE: The above assumes that you are programming in C# in Visual Studio/Test Studio. If you are using a different language and/or dev environment, look up the appropriate documentation to find the equivalent tasks to accomplish the above (Telerik should be able to help you if needed).
Hope that helps,
Shashi
The coded approach works for me, I needed to keep SimulateRealUser turned on as I need to process the key events so the other approach didn't work. It would be good if this was an option in the properties window as having to resort to coded tests moves the tool from a QA user into a developer only tool.
--
Scott
@Shashi - Thank you for sharing with us this workaround!
@Scott - It is good to hear that this workaround helped you. We have already logged a feature request for including a property to control the clear text behavior for Silverlight, which you can track here.
Velin Koychev
Telerik
You are welcome. But the credit for the workaround actually goes to another Telerik Support engineer (Mario). He sent this to us in response to a support case logged as a result of the following thread:
http://www.telerik.com/automated-testing-tools/community/forums/test-studio/general-discussions/disabling-simulaterealuser-breaks-data-driven.aspx
Shashi