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

Kendo angular autocomplete value is not selecting from dropdown

3 Answers 516 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Srilatha
Top achievements
Rank 1
Srilatha asked on 04 Nov 2020, 02:26 PM

Hi team,

The kendo angular dropdown is working in some places and not working in some places. 
 
I have kendoangularautocomplete step in 2 places, In one place it is working fine but in other place it is not working,  it seems like the step is passing but not taking the value from drop down.
 
Previously it is recorded with field ID(from html Id), 
but now when try to record the same step it is recording with some other id(like guid). 
attached screenshots for previous recorded and new recorded.

I am using  30 days trial version, and there is no changes in developing side,

So, can you please help me on this issue

 

Thanks & Regards

Srilatha

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 05 Nov 2020, 04:45 PM

Hello Srilatha,

Thank you for providing thorough details for the encountered misbehavior. 

I reviewed the recorded tests and there is a general recommendation to share about automating drop-down controls. It seems that you have used the keyboard arrow keys to select an item from the drop-down list in both tests. Such approach is not very reliable in automated tests because the keyboard keypress steps are being sent against the control currently on focus. During an automated run, this focus can be easily switched to an element you do not need. 

Therefore, it will be more consistent, if you select the item from the drop-down list using a click step. That way, the target element for the step will be the correct element. 

Moreover, Test Studio provides built-in translators for the Telerik Kendo controls. This is how entering some text in the drop-down to filter the list resulted in the step 'KendoAngularAutocomplete value 'a' entered'. If you directly click on the desired item, once it was filtered, you will end up with a step similar to 'KendoAngularListbox: select item by text ''.

And one more note - to ensure that the test will pass, no matter what is the speed of application responsiveness, you will need to add a wait step to ensure the item to select from drop-down list is visible before the test attempts to click on it. 

So, the sample scenario will be as follows: 

  • type any value in the drop-down 
  • wait until the desired item is visible
  • click on this item.

Please, find attached a sample test scenario prepared against a Telerik demo page, which demonstrates this recommended approach. I hope this will be helpful for you. Do not hesitate, though, to get back to me in case of any questions. 

P.S. To be able to review and execute the test on your end, you can use the option to add an existing test in your project.

Regards,
Elena
Progress Telerik

Do not forget to sign up for the upcoming Test Studio Release Webinar. You will see what a real blazing fast recording experience is. See you on 11 November, 11 am ET.
0
Srilatha
Top achievements
Rank 1
answered on 06 Nov 2020, 06:11 AM

Hi Elena,

Thank You for your reply. executed the script which you provided, it is executed fine, I will modify my scripts for keypress actions.

But why is it taking GUID instead of Id (from Html) with new recording. 
and the extracted step for input field is also failing where there is no dropdown, 
previously it is extracted with html id  now it is extracting with GUID.

why is it changing the ID?

can you please help me on this issue.

Thanks & Regards
Srilatha

0
Elena
Telerik team
answered on 06 Nov 2020, 01:07 PM

Hi Srilatha,

I am pleased to know that the sample test will help you understand the approach to use for dropdown controls. 

In regards your other query about elements as far as I understand you refer to the names of the elements used in the steps.

If I have understood you right, then, please, note that this is only the name of the recorded element, which is automatically generated based on the element's attributes. This is how you can find the element across the steps in the test, or in the Elements Explorer within Test Studio.

However, this name is not related to how the element is being located on the page during test execution. Each element recorded in Test Studio is using a set of attributes, which uniquely identify the element on the page - this is called element's find expression. And these is the criterion used to look for an element on the page, when a step needs to act upon or verify the element. To verify what is the current find expression used from the recorded elements, you can open any of these these in Edit mode and check how it will be located on the page. Additionally you can modify the find expressions as per the page structure and static attributes it uses for the elements. The approach to modify an element is usually in a live recording session

The find expressions in Test Studio are also generated automatically based on the element's attribute values and the custom find logic settings you can apply on project level. The default list of find logic criterion starts with id. But if the ids are dynamically generated in the application under test, it is not ideal to rely on these. This is why Test Studio allows you to reorder the attributes to use and/or add custom tags depending on the application under test specifics. 

I hope that this will be of further help for you. But, please, do not hesitate to get back to me in case of any further doubts. 

Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

Do not forget to sign up for the upcoming Test Studio Release Webinar. You will see what a real blazing fast recording experience is. See you on 11 November, 11 am ET.
Tags
General Discussions
Asked by
Srilatha
Top achievements
Rank 1
Answers by
Elena
Telerik team
Srilatha
Top achievements
Rank 1
Share this question
or