HtmlInputText.Text accepting only max length characters

11 posts, 0 answers
  1. Kiran
    Kiran avatar
    12 posts
    Member since:
    Nov 2010

    Posted 02 Feb 2011 Link to this post

    Hi,

    We have a requirement to test a editbox; to enter a test string of length>16
    [editbox should accept a string with a max length of 16 only]

    i am using htmlinputText.Text = "some value i would enter here";
    it's accepting the strings whose length is more than 16.

    where as the same editbox doesnot accept string of length more than 16 when we "actually type in".

    Please help.

    thanks and regards,
    Kiran K N
  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 04 Feb 2011 Link to this post

    Hello Kiran,
        sounds like simulating real typing might do the trick. 

    Use this method:
    Manager.Desktop.KeyBoard.TypeText
    e.g
    Manager.Desktop.KeyBoard.TypeText("This is some text", 50, 100);

    Let me know whether this works!

    Regards,
    Stoich
    the Telerik team
    Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
  3. Kiran
    Kiran avatar
    12 posts
    Member since:
    Nov 2010

    Posted 06 Feb 2011 Link to this post

    Hi Stoich,

    thanx for your reply.
    yes this works.
    Until now we were trying not to use keyboard/mouse context. (since many testcases would fail if these two devices are disturbed or for any other reasons).

    Is this the only way(using keyboard/mouse) to achieve this(my original question)?

    or is there any other workarounds???
    pls let me know.


    Thanks and Regards,
    Kiran K N.
  4. Kiran
    Kiran avatar
    12 posts
    Member since:
    Nov 2010

    Posted 06 Feb 2011 Link to this post

    Hi Stoich,

    In addition to the above reply.
    I observed one more failing scenario.

    //code block
    inputTextControl.Focus();
    inputTextControl.MouseClick();
    //write the text
    kb.TypeText("Some string to be entered", 20);

    I am using the above code block.
    The testcase was passing in the normal scenario writing to a proper edit box.

    But incase i maximise the browser. the text would be written in some other control and the Testcase would fail.

     

  5. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 07 Feb 2011 Link to this post

    Hello Kiran,
         yes, those are the only two ways you can set the Text of a element. I hope this won't get in the way of your TestCase.

    Minimizing/maximizing a browser shouldn't affect the way the WebAii Framework locates elements. The problem is likely  caused by your find logic. Would you please paste the logic that locates this element as well as the HTML code for this element. This info will allow me to analyze the issue!

    Hope to hear from you soon!   

    Kind regards,
    Stoich
    the Telerik team
    Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
  6. Kiran
    Kiran avatar
    12 posts
    Member since:
    Nov 2010

    Posted 07 Feb 2011 Link to this post

    Hello Stoich,

    sorry there was a mistake in my previous comment.

    It's not maximise.

    It's changing the zoom. test cases using keyboard type text did fail if the browser was zoomed in.....(increasing the zoom)

    Thanks and Regards,
    Kiran K N
  7. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 09 Feb 2011 Link to this post

    Hello Kiran,
       your browser should be set to 100% zoom level when you're running tests. Changing zoom levels changes the coordinates within the browser and this can cause some types of steps to fail. Keep your execution browsers set to 100% to avoid problems.

    I hope this helps!

    Regards,
    Stoich
    the Telerik team
    Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
  8. Kiran
    Kiran avatar
    12 posts
    Member since:
    Nov 2010

    Posted 09 Feb 2011 Link to this post

    Hi Stoich,

    thanx for your reply.

    I actually thought there would be some setting in manager or browser, so that the changes in zoom level doesn't affect test steps.

    One more observation: This "zoom level changes" problem only affects win32 API's like keyboard and mouse operations.

    all other tests executes properly :)

    Regards,
    Kiran K N.
  9. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 10 Feb 2011 Link to this post

    Hi Kiran,

        thank you for the feedback, let me know if you have any other questions!

    All the best,
    Stoich
    the Telerik team
    Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
  10. RamaRao
    RamaRao avatar
    1 posts
    Member since:
    Aug 2011

    Posted 02 Aug 2011 Link to this post

    New to WebAii
    The below is the way I enter input how do I do with Manager.Desktop.KeyBoard.TypeText

    PageManager.ManageFields.CustomFieldDetail.Elements.ValuesGrid.SetName(0, TestDataManager.DataGenerator.RandomString(101));

    Manager.Desktop.KeyBoard.TypeText("This is some text", 50, 100);
    What does 50 and 100 represent?
  11. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 02 Aug 2011 Link to this post

    Hello Ramarao,

    The TypeText function types keystrokes one letter at a time. The Intellisense in VisualStudio shows us that the 50 represents how much delay to insert in between each each keystroke and the 100 represents how long to simulate holding down the keystroke.

    Best wishes,
    Cody
    the Telerik team
    Check out the Test Studio roadmap to find out more about the new performance testing functionality coming in our R2 2011 release this September!

    Have you looked at the new Online User Guide for Telerik Test Studio?
Back to Top