This is a migrated thread and some comments may be shown as answers.

Why does type 'x' into textbox clear the text

7 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Scott Waye asked on 31 Aug 2013, 05:01 PM
This seems to be some kind of default behaviour whereby typing characters first backspaces all the existing text.  I don't want that as it breaks my functionality.  Think of an intellisense box where you type, pick something from a popup, type some more.

7 Answers, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 05 Sep 2013, 07:11 AM
Hello Scott,

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
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Sep 2013, 07:08 PM
I already have SimulateRealUser checked.  Any other ideas?
0
Velin Koychev
Telerik team
answered on 06 Sep 2013, 01:28 PM
Hi Scott,

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.

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Shashi
Top achievements
Rank 1
answered on 06 Sep 2013, 04:37 PM
You can also avoid it clearing the text field with SimulateRealUser turned on as follows:

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
0
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 07 Sep 2013, 10:58 AM
Thanks,

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
0
Velin Koychev
Telerik team
answered on 11 Sep 2013, 11:16 AM
Hello,

@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.

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Shashi
Top achievements
Rank 1
answered on 11 Sep 2013, 04:59 PM
Scott and Velin,

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
Tags
General Discussions
Asked by
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Velin Koychev
Telerik team
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Shashi
Top achievements
Rank 1
Share this question
or