Set Value of input directly without typing? (Telerik Test Studio)

1 Answer 33 Views
Coded Steps Coded Tests Elements General Discussions Test Configuration
Daniel
Top achievements
Rank 1
Iron
Daniel asked on 24 Aug 2021, 07:43 PM | edited on 24 Aug 2021, 07:55 PM

Hello,

I am currently trying to automate selecting a value from a dropdown to find a company by code (not a select). For example the company code may be WRC. If I type "WR" it goes from showing all the companies beginning with "W", to then all the companies beginning with "R". upon inspecting the element, its an input field, with an ID and Value properties, in light of this is there any way i can, through code or otherwise directly set the value of the input field without using the simulated typing?

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
Iron
answered on 25 Aug 2021, 12:52 PM
Hey, answering my own question. Again a pretty simple fix. Once I turned off the "Simulaterealtyping" it worked.
Elena
Telerik team
commented on 25 Aug 2021, 01:24 PM

Hi Daniel, 

Thanks very much for following up your question with the right answer. It is great that disabling the 'SimulateRealTyping' did the trick for you.

As an additional note I would like to mention that not using the option to simulate real user actions (click and type), might require to manually add steps to invoke the JavaScript events on the page related to the target element. 

Here is an example to illustrate this: Sending the company code WRC to the text field (without the 'SimulateRealTyping' option) in the dropdown does not filter the dropdown list values. If this was the case, you need to check what JS events are triggering the filtering and add invoking these as steps in the test. 

I hope that this is also useful information. 

Best Regards, 
Elena

 

Daniel
Top achievements
Rank 1
Iron
commented on 25 Aug 2021, 04:30 PM

Hey, you are correct., without the 'SimulateRealyTyping' the input changes, but the list does not filter. I will take a look at the link you have provided and hopefully it solves my problem fully.

Thank you!

Elena
Telerik team
commented on 30 Aug 2021, 12:56 PM

Hi Daniel, 

Thanks for the follow up!

I hope the suggested approach will work for you. If you are not sure what JS events you need to trigger, you can use Firefox to inspect the elements in the DOM - this browser's Developers Tools lists all the events tied to an element. 

Don't hesitate to contact us again in case you still need assistance on the topic. 

Regards,
Elena

Tags
Coded Steps Coded Tests Elements General Discussions Test Configuration
Asked by
Daniel
Top achievements
Rank 1
Iron
Answers by
Daniel
Top achievements
Rank 1
Iron
Share this question
or