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
0
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
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
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
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:
Please, try any of the above and let me know if you need further assistance. I stay at your disposal.
Regards,
Vera
Progress Telerik
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