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

Recording thinking that no text is entered into input field when it should be

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 17 Jan 2014, 09:32 AM
Hi All

After recording a test step where I enter text into a input box, and I attempt to run it. The recording shows that the text is entered however when I select the search button I do not get the expected result I'm looking for. I have attempted this manually and it works fine. What I am suspecting is that the recording for some reason things that the text is not entered in the input field.

Below is the code in which i am using to attempt to enter the text

Pages.Orders.ProductSearchTermInputText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
ActiveBrowser.Window.SetFocus();
Pages.Orders.ProductSearchTermInputText.Focus();
Pages.Orders.ProductSearchTermInputText.MouseClick();
Manager.Desktop.KeyBoard.TypeText("alice", 50, 100); 

and here is the html that the input field is using

<input class="t-input" id="ProductSearchTerm-input" name="ProductSearchTerm-input" type="text" autocomplete="off">

Thanks

Chris

1 Answer, 1 is accepted

Sort by
0
Accepted
Velin Koychev
Telerik team
answered on 22 Jan 2014, 09:01 AM
Hi Chris,

I am sorry to hear that  you are experiencing this issue.

Usually the code that you are using should simulate real typing. If I understand you correctly, entering the text should trigger some Javascript function which calls others text boxes?

In order to resolve this, you can try to set the TriggerjQueryEvent property of the step to true. You can do this manually in a coded step. See here for more information. 
For example:
Pages.ProjectName.CheckBox.AsjQueryControl().InvokejQueryEvent(ArtOfTest.WebAii.jQuery.jQueryControl.jQueryControlEvents.change);
This code will trigger the jQuery ".change" event of a checkbox. 
Please change this line of code according to your needs (i.e. change the element and the event if needed).

We have also logged a feature request on this, which you can follow in our Feedback Portal.

You might also find useful reading our documentation about working with Javascript in coded steps. 

If this doesn't help you, please provide us with a copy of your test and if it is possible grant us access to your application so we can reproduce the issue on our end and give you a solution.

Looking forward to hearing from you.

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Christopher
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Share this question
or