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

How do I record <sometext><ENTER>

3 Answers 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 11 Jul 2018, 07:59 PM

I have a search box where I type some text in, hit enter and it redirects me.

The recorder though only records the text not the ENTER... what should I be doing?

3 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 13 Jul 2018, 03:10 PM
Hello Steve,
  
Thank you for contacting us.

In this case you can check out how to Invoke Keyboard Typing article and let me know how it works for you.

If you have additional questions, do not hesitate to contact me again.

Regards,
Vera
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 16 Jul 2018, 06:43 PM

Enter doesn't seem to be triggered...

Am I doing this wrong?

[CodedStep(@"Enter text 'support@site.ca' in 'UserSearchBox'")]
        public void Directory_SearchUser()
        {
            // Enter text 'support@medportal.ca' in 'UserSearchBox'
            Actions.SetText(Pages.DirectoryDetail.UserSearchBox, "support@site.ca");
            Manager.Desktop.KeyBoard.KeyPress(Keys.Enter, 200);
        }
0
Vera
Telerik team
answered on 17 Jul 2018, 12:49 PM
Hello Steve,

Thank you for getting back to me.
  
From the provided code snippet I can see you are using SetText action which does not trigger any focus on the element. For this the enter step is not working. The solution is to invoke mouse click action between the two steps you have.

Let me provide you with two options on how you can achieve this: 

[CodedStep(@"Option 1")]
        public void WebTest1_CodedStep()
        {
            ActiveBrowser.NavigateTo("http://google.com/", true);
            Actions.SetText(Pages.Google.LstIbText, "aaa");
            Pages.Google.LstIbText.MouseClick();
            Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);
        }

[CodedStep(@"Option 2")]
     public void WebTest1_CodedStep1()
     {
         ActiveBrowser.NavigateTo("http://google.com/", true);
         Pages.Google.LstIbText.MouseClick();
         Manager.Desktop.KeyBoard.TypeText("aaa");
         Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter,200);
     }

Please, try any of the above and let me know if you need further assistance. I stay at your disposal.

Regards,
Vera
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Vera
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or