Solution 1 :

You can click on the button Open Selector Playground. Then you can simply click on the input field and you get the code on how to “get” it.

enter image description here

This will appear and on the right site of the window you can directly copy the code.

enter image description here

Solution 2 :

Right click element and click Copy > Copy Selector

In your test:

cy.get('Selector')

Solution 3 :

You can grab an element by id, class, or other HTML attributes. So a few potential options would be:

  • cy.get(‘input[aria-invalid=”false”]’)
  • cy.get(‘input[type=”number”]’)
  • cy.get(‘.MuiInputBase-input-1102)

Problem :

I have something like this:

<input aria-invalid="false" type="number" min="1" class="MuiInputBase-input-1102 MuiInput-input-1141" value="1">enter image description here

how to get to it ??

Comments

Comment posted by sulox32

what do you mean by how to get there? what exactly do you want?

By