Find Input Element By The Current Value

Опубликовано: 16 Июнь 2023
на канале: gleb bahmutov
617
25

This video shows how to find an input element by its "value" attribute. You can find elements using the exact static value, or its prefix, or suffix, or even matching part of the string value. But what about the input elements with the value set dynamically by the application? You no longer have the attribute to select the element, you must filter the input elements yourself. For example, to find the input element with the string "0" in its current value you could write:
cy.get('input#area').type('404')
cy.get('input')
.filter(function (k, input) {
return input.value.includes('0')
})
.should('have.value', '404')
This recipe comes from http://glebbahmutov.com/cypress-examp...


Смотрите видео Find Input Element By The Current Value онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь gleb bahmutov 16 Июнь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 617 раз и оно понравилось 25 людям.