Manager.Desktop.KeyBoard.TypeText not inserting text

7 posts, 0 answers
  1. Jan
    Jan avatar
    7 posts
    Member since:
    May 2016

    Posted 06 Jun Link to this post

    Hello! I am having some trouble with the Manager.Desktop.KeyBoard.TypeText() method. I recorded an action that inserts data into a field as so:

    // Enter text '1.01' in 'SSLCERTEVSSLSummarySinglePriceText'
    Actions.SetText(Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummarySinglePriceText, "");
                Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummaryServicePriceText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
    ActiveBrowser.Window.SetFocus();
    Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummaryServicePriceText.Focus();
    Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummaryServicePriceText.MouseClick();
    Manager.Desktop.KeyBoard.TypeText("1.01",100);

    However the text is not being set in the field. My first attempt at solving was problem was noting that the recorded action was attempting to set the data twice in this code block:

    -Actions.SetText(Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummarySinglePriceText, "");
    -Manager.Desktop.KeyBoard.TypeText("1.01",100);

     

    So I commented out the last 5 lines and ended up with:
    Actions.SetText(Pages.EntrustPartnerPortal6.SSLCERTEVSSLSummarySinglePriceText, "");

    and inserted my data between the blank quotations. This did not work either, because data was being set on the text field yet upon proceeding, valdiation did not recognize text in the box as if it was blank.

    Any help here would be appreciated, if anyone needs more info on how to solve this problem please let me know, thanks!

  2. Jan
    Jan avatar
    7 posts
    Member since:
    May 2016

    Posted 06 Jun in reply to Jan Link to this post

    I can confirm that I am having the same problem on a field that takes in a date. To reiterate, all I am doing is recording a set text action and the text will not be inserted during playback.
  3. Jan
    Jan avatar
    7 posts
    Member since:
    May 2016

    Posted 07 Jun Link to this post

    I fixed this by adding the data as a data source (in the local data tab) instead of hardcoding the values. Weird. 
  4. Jan
    Jan avatar
    7 posts
    Member since:
    May 2016

    Posted 07 Jun in reply to Jan Link to this post

    Scratch that, still doesn't work.
  5. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    253 posts

    Posted 09 Jun Link to this post

    Hello Jan,

    Thank you for your interest in Telerik Test Studio. i would be glad to assist you on that issue but I will need some further details on that topic. 

    Please first of all let us clarify if you are using Test Studio standalone version, the VS plugin or the testing framework only. 

    Since you are recording your steps I assume you are using the standalone version. In this scenario I would like to ask whether you have tried to check the 'SimulateRealTyping' option (refer to the screenshot)? Is there any difference in the execution? 

    Would it possible to provide us your application and the script that fails? 

    Please gather both the application and execution logs and provide them via this thread to continue the investigation. 

    Thank you in advance for the cooperation. I hope to hear from you soon. 

    Regards,
    Elena Tsvetkova
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  6. Geoffrey Hudik
    Geoffrey Hudik avatar
    15 posts
    Member since:
    Jan 2010

    Posted 14 Sep in reply to Elena Tsvetkova Link to this post

    I had this same problem and in my case it turned out to be that by default unicode support is there. Setting the supportUnicode parameter to false for TypeText did the trick. 

     

    I also added a number of other insurance steps which I "disassembled" from Telerik Test Studio by converting a simulated typing step to a coded step and added similar checks.

     

    Below are the helpers in my base class:

    protected virtual void TypeText(string input)
    {
        // unicode must be false, otherwise input doesn't work (at least on angular typeaheads)
        Manager.Desktop.KeyBoard.TypeText(input, 50, 100, supportUnicode:false);
    }
     
    protected virtual void TypeText(HtmlInputControl control, string input)
    {
        control.ScrollToVisible(ScrollToVisibleType.ElementTopAtWindowTop);
        ActiveBrowser.Window.SetFocus();
        control.Focus();
        control.MouseClick();
        TypeText(input);
    }

  7. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    253 posts

    Posted 19 Sep Link to this post

    Hi,

    Thank you for adding that note. I hope the information will be sufficient though if further assistance is required Test Studio Support Team will be glad to help. 

    Regards,
    Elena Tsvetkova
    Telerik by Progress
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top