Cannot enter value in Numeric only text box

15 posts, 0 answers
  1. QA
    QA avatar
    16 posts
    Member since:
    Mar 2011

    Posted 05 Aug 2011 Link to this post

    Hi,

    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
  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 08 Aug 2011 Link to this post

    Hello Dipti,
        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
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  3. QA
    QA avatar
    16 posts
    Member since:
    Mar 2011

    Posted 08 Aug 2011 Link to this post

    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

     

  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 11 Aug 2011 Link to this post

    Hello 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
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  5. Shashi
    Shashi avatar
    25 posts
    Member since:
    Feb 2011

    Posted 11 Aug 2011 Link to this post

    Hi Stoich,

    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
  6. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 12 Aug 2011 Link to this post

    Hi 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);
    }

    All the best,
    Cody
    the Telerik team
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  7. Shashi
    Shashi avatar
    25 posts
    Member since:
    Feb 2011

    Posted 12 Aug 2011 Link to this post

    Hi Cody,

    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
  8. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 15 Aug 2011 Link to this post

    Hi 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;

    And this dll import:
    [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.
    Best wishes,
    Cody
    the Telerik team
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  9. Shashi
    Shashi avatar
    25 posts
    Member since:
    Feb 2011

    Posted 23 Aug 2011 Link to this post

    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

  10. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 24 Aug 2011 Link to this post

    Hello 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
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  11. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 09 Sep 2011 Link to this post

    Hi Shashi,

    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
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  12. Mohammed
    Mohammed avatar
    1 posts
    Member since:
    Aug 2015

    Posted 19 Aug 2015 in reply to Cody Link to this post

    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

  13. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 24 Aug 2015 Link to this post

    Hello Mohammed,

    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
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  14. Arbind
    Arbind avatar
    8 posts
    Member since:
    Apr 2014

    Posted 12 Aug Link to this post

    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.

  15. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 17 Aug Link to this post

    Hi Arbind,

    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
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top