Chromeless - select drop down value

99 Views Asked by At

I am using chromeless to change the value of a drop down menu:

var dropDownValue="59"
const screenshot2 = await chromeless
        .evaluate((dropDownValue) => {
            select = document.querySelector('select#category1')
            select.value = dropDownValue
        })

but this is not giving the expected behavior, the drop down menu is set to a "blank" option (which does not even exist in the menu).

What could be going wrong?

1

There are 1 best solutions below

0
Sulli On BEST ANSWER

Correct syntax is:

var dropDownValue="59"
const screenshot2 = await chromeless
        .evaluate((dropDownValue) => {
            select = document.querySelector('select#category1')
            select.value = dropDownValue
        }, dropDownValue)

I don't know why this question was voted down. You might be experts at Chromeless, I'm not.