filmov
tv
Get And Set Multiple Elements Attributes
Показать описание
This video shows how to get the same HTML attribute from multiple elements in Cypress tests:
- jQuery "attr" method returns the value of the attribute from the first element only
- you can invoke the DOM getAttribute method on each DOM element to get the values (use my cypress-map plugin)
- to set the same attribute value, use jQuery attr(name, value) call or attr(name, callback)
- jQuery "attr" method returns the value of the attribute from the first element only
- you can invoke the DOM getAttribute method on each DOM element to get the values (use my cypress-map plugin)
- to set the same attribute value, use jQuery attr(name, value) call or attr(name, callback)