I am having issue entering value (numeric) in Numeric only text box. While recording I entered all numeric value. However, when I execute my test, it does not seem to type in anything but the step passes and continues. Here is an example of the text box. Please let me know how I can successfully add numeric data to numeric only text box (via coded step or recording).
<TextBlock x:Uid="TextBlock_2" Grid.Row="0" Grid.Column="0" Margin="3,2,3,0" Text="Numeric ID" AutomationProperties.AutomationId="TextBlock_2" />
<TextBox x:Uid="txtNumericID" x:Name="txtNumericID" Grid.Row="1" Grid.Column="0" Margin="3,1,17,2"
Text="{Binding NumericEdit.NumericID, Mode=TwoWay,ValidatesOnExceptions=True}"
adr:BusinessBaseBehavior.BusinessRulesSource="{Binding Path=NumericID.NumericID, Mode=TwoWay}"
MaxLength="10">
<interactivity:Interaction.Behaviors>
<behaviors:TextBoxFilterTypeBehavior Filter="Integer"/>
</interactivity:Interaction.Behaviors>
Thank You,
Dipti
17 Answers, 1 is accepted
I was unable to reproduce this issue. Would you please send me a working Silverlight project that demonstrates the problem. I created a Silverlight app with the XAML code you've provided but I didn't experience any problem with setting numeric values into the TextBox.
Kind regards,
Stoich
the Telerik team
Hi Stoich,
I don't have any demonstration project to send you. The issue seems to be because of
<interactivity:Interaction.Behaviors>
<behaviors:TextBoxFilterTypeBehavior Filter="Integer"/>
</interactivity:Interaction.Behaviors>
Can you please create this behavior and see if you can recreate the issue?
The text box does not display any string value so it looks like whatever is typed into the text box is a string.
Is there a way to enter integer into textbox with coded steps:
Pages.QA.SilverlightApp.NumericIDTextbox.User.TypeText(NumbericValue, 10, 100,
true);
Thank You,
Dipti
I did a bit of research on Silverlight Interaction Behaviors.
Unfortunately it seems Interaction Behavior is complex to implement and requires substantial knowledge and experience with Silverlight. There's no one on our support team that can create the project without devoting excessive amounts time for research. With this is mind I would like to once again ask you to provide a working project which we can examine. Once we have the project we will try to determine and resolve the issue ASAP.
If you have reservations about sharing data on a public forum you can open a support ticket. Support tickets are 100% confidential. We can also arrange an NDA if your policy requires it.
All the best,
Stoich
the Telerik team
Attached zip file has a VS solution with a sample Silverlight web app that shows a text box and a Save button. Text box has the behavior that Dipti provided. Solution also has a test that was recorded against this app - running it shows the problem.
If test has trouble connecting to the app, check (and if necessary update) the url by running the sample app on your system.
We await your feedback.
By the way, we are running WebUI 2010 R3 - and we cannot currently upgrade to WebUI 2011 (see Support ID 425811).
Shashi
Thank you very much for the sample project. I have replicated the problem. It seems our method for SimulateRealUser is not compatible with Silverlight behavior's. I have filed a bug on this here.
I was able to come up with a coded step work around:
[CodedStep(@
"Type '1234' into TxtProviderNpiTextbox"
, RequiresSilverlight =
true
)]
public
void
WebAiiTest1_CodedStep()
{
// Type '1234' into TxtProviderNpiTextbox
//Pages.SilverlightTestApp.SilverlightApp.TxtProviderNpiTextbox.SetText(true, "1234", 10, 100, false);
Pages.SilverlightTestApp.SilverlightApp.TxtProviderNpiTextbox.User.Click();
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.D1);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.D2);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.D3);
Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.D4);
}
Cody
the Telerik team
Thanks for logging the defect. What is the ETA for the fix to this defect?
This issue is preventing us from running a critical test in our smoke test suite. So could you ask for a high priority for the fix to this issue?
Also, as you are well aware, we cannot currently consume 2011 builds. So could you request your dev team to deliver a fix that will work with 2010 R3?
Regarding the workaround, it is a possibility as long as the value is known and fixed. I expect that the code would get real complicated in a hurry if the text entry is coming from an external file and we don't know its length. We would have to separate the number into its individual characters and find its corresponding member in System.Windows.Forms.Keys - perhaps in a loop. But we will look into it.
Thanks again.
Shashi
For unshifted characters you can use this coded loop:
string
input =
"12345 Now is the time"
;
foreach
(
char
c
in
input)
{
System.Windows.Input.Key wpfKey = KeyInterop.KeyFromVirtualKey(VkKeyScan(c));
Keys formsKey = (Keys)KeyInterop.VirtualKeyFromKey(wpfKey);
Manager.Desktop.KeyBoard.KeyPress(formsKey, 10);
}
If the character (e.g. N @ $) requires the shift key, you'll have to detect it, convert it to it's unshifted equivalent, when send Shift Down, the translated character (just use ToLower for upper case letters) followed by Shift Up.
I admit it can get a bit messy if you need to handle all possible characters. If all you need is numbers (which appears to be true in this instance), then the above loop is all you need.
It also needs these using statements:
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Windows.Input;
[DllImport("user32.dll")]
static extern short VkKeyScan(char ch);
I cannot give you an ETA for this fix yet. My developers haven't had the chance to investigate the root cause yet and come up with possible solutions. Until then we don't know the code change effort involved.
What is your current status on the McAfee anti-virus problem you are experiencing?
I will discuss creating a special 2010 R3 build containing this fix for you with the product manager.
Cody
the Telerik team
Hi Cody,
I implemented your workaround and it is working well. Thank you! I don't think we need to handle all characters (the character is not displayed if you try to implement a non-numeric character) and so the code you gave us works just fine.
Please do let us know when the real fix is available.
I also have some good news about the WebUI 2011 issue - will let you know in the relevant thread.
Thanks again for all your help,
Shashi
I will be glad to let you know when we have a fix for this. I have to admit the bad news is that it has been deemed too risky to try and fix before our next major release which is due out the middle of September. The problem is that this affects all of our simulated keyboard typing. Since the problem is only being seen in controls that have a Behavior attached, we can't risk breaking those working scenarios at this time. We plan to address it after that time.
Kind regards,Cody
the Telerik team
I have good news to report. My developer just finished reviewing this problem and informed me no fix is required. You just need to turn on both SimulateRealUser and FireKeyEvents (see attached screen shot). I missed the latter setting (which is my mistake).
Regards,Cody
the Telerik team
Hi Cody,
I faced the same issue like above today.
The scenario which i performed include inputting the text boxes with username,password,phone number,address etc.
The script was working fine till yesterday, and now it is navigating to URL successfully,but unable to input values in text box and password but results are getting passed after execution for login. I have verified chrome extensions and chrome browser settings for Telerik. They are all upto date.I've also tried clearing cache.
Note : I'm facing this issue only in chrome but in IE its working fine.
So can you please let me know what is the possible issue
What have changed since yesterday? Have you upgraded something (Test Studio, Chrome or your application)?
What script do you use for inputting the credentials? Send us a code spinet.
Hope to hear from you soon.
Regards,
Boyan Boev
Telerik
Hello Team,
In my application there is a text bot which allow numeric only and it will insert input from right to left.like if u want to insert 1 than .1,.01,1.00.It it will go inserting right to left.I have recored that steps and during execution that step got passed but it did not enter anything.
How to do that.
Could you please try enabling SimulateRealTyping property of the enter number step (see the attached screen shot).
If the issue persists please record a short video so we can better understand that is happening exactly.
Thank you!
Regards,
Boyan Boev
Telerik by Progress
Hi Cody,
When I record my web test , a text field which hold numeric value is unable to detect. The recorded code is displayed as Click 'CustomerPhoneNumberNotSet'
Can you please help me get this working , so that i can automate my application
Thanks,
Noorain
When I record my web test , a text field which hold numeric value is unable to detect. The recorded code is displayed as " Click 'CustomerPhoneNumberNotSet' "
Can you please help me get this working , so that i can automate my application
Thanks,
Noorain
Thank you for reaching us out.
Please let me know which is the browser you use for recording? Did you try to record that step with any of the other supported browsers and if so what the behavior is?
Next thing I would recommend would be to use the Elements menu and locate the text field in the DOM tree. Then add a step manually from the Step Builder in the recorder toolbar. Then once a step is added you could double check the element's find expression and if this is actually pointing to a single unique element on the page - depending on the application structure you might need to modify the recorded find expression.
Optionally it might be required to enable 'SimualteRealTyping' for that step as it is listed in the previous comments.
I hope the above recommendations will be helpful to you but in case you still need assistance on any topic please try to prepare a sample application or provide a public accessible one to test the misbehavior against.
Thank you in advance!
Regards,
Elena Tsvetkova
Progress Telerik