addValue
Aggiungi un valore a un elemento input o textarea trovato tramite il selettore specificato.
informazione
Se desideri utilizzare caratteri speciali, ad esempio per copiare e incollare un valore da un input a un altro, usa il comando
keys
.
Utilizzo
$(selector).addValue(value)
Parametri
Nome | Tipo | Dettagli |
---|---|---|
value | string, number | valore da aggiungere |
Esempio
addValue.js
it('should demonstrate the addValue command', async () => {
let input = await $('.input')
await input.addValue('test')
await input.addValue(123)
value = await input.getValue()
assert(value === 'test123') // true
})