Search code examples
testingkendo-uiautomationcypress

Select Kendo ComboBox in Cypress


I have problem with selecting value from combobox in Cypress. It allways writes me that:

CypressError: cy.select() can only be called on a <select>. Your subject is a: <span unselectable="on" class="k-select" aria-label="select" role="button" tabindex="-1" aria-controls="fabric_listbox">...</span>
Types text into numeric inputs

My code looks like this:

describe('KendoUI', () => {

  it('types text into numeric inputs', () => {

    cy.visit('https://demos.telerik.com/kendo-ui/combobox/index');

    cy.get(':nth-child(4) > .k-dropdown-wrap > .k-select').select('Polyester')
  })
})

Can you please give me some help? You could try it on this page: https://demos.telerik.com/kendo-ui/combobox/index

Thank you.


Solution

  • I resolved it.

    1. Make cy.click() on the element

    2. Found with cy.contains() text what is in the box and then click on it (cy.contains('text').click)