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

Manager.Desktop.KeyBoard.TypeText not inserting text

6 Answers 273 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 06 Jun 2016, 06:24 PM

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!

6 Answers, 1 is accepted

Sort by
0
Jan
Top achievements
Rank 1
answered on 06 Jun 2016, 07:10 PM
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.
0
Jan
Top achievements
Rank 1
answered on 07 Jun 2016, 05:58 PM
I fixed this by adding the data as a data source (in the local data tab) instead of hardcoding the values. Weird. 
0
Jan
Top achievements
Rank 1
answered on 07 Jun 2016, 07:36 PM
Scratch that, still doesn't work.
0
Elena
Telerik team
answered on 09 Jun 2016, 02:28 PM
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
 
0
Geoffrey Hudik
Top achievements
Rank 1
answered on 15 Sep 2016, 12:48 AM

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

0
Elena
Telerik team
answered on 19 Sep 2016, 10:23 AM
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
 
Tags
General Discussions
Asked by
Jan
Top achievements
Rank 1
Answers by
Jan
Top achievements
Rank 1
Elena
Telerik team
Geoffrey Hudik
Top achievements
Rank 1
Share this question
or