Anagha Premkumar
Anagha Premkumar

Reputation: 41

Cypress error. cy.type() failed because it requires a valid typeable element

cy.type() failed because it requires a valid typeable element.

The element typed into was:

...

A typeable element matches one of the following selectors: a[href] area[href] input select textarea button iframe [tabindex] [contenteditable]

I was trying to locate a field to enter date and it shows an error like this. But i have automated the field like same before without any errors.

Upvotes: 4

Views: 4423

Answers (1)

Jason Scaggs
Jason Scaggs

Reputation: 225

You should be able to find an <input> within the <div>.

Not sure exactly what selectors you used, but this would be an example:

cy.get('div.mat-form-field-infix')
  .find('input')
  .type('21-10-2022')

Upvotes: 3

Related Questions