joelgriffith / navalia

A bullet-proof, fast, and reliable headless browser API
https://joelgriffith.github.io/navalia/
GNU General Public License v3.0
957 stars 33 forks source link

.select throws ReferenceError: option is not defined #71

Open estwanick opened 6 years ago

estwanick commented 6 years ago

When trying to change the value of a dropdown using select chrome.select returns ReferenceError: option is not defined

async function test() {
    await chrome.goto('http://localhost:3000/pva');
    const x = await chrome.exists('#accountViewSelector') //true
    const y = await chrome.html('#accountViewSelector') //returns correct dropdown <select ..
    const z = await chrome.select('#accountViewSelector', '0'); // ReferenceError: option is not defined
    chrome.done();
}

test();

Sole component being rendered

const PortfolioValueAnalysis = () => {
    return (
        <select id='accountViewSelector' className="form-control">
            <option value='0'>0</option>
            <option value='1'>1</option>
            <option value='2'>2</option>
        </select>
    )
}

export default PortfolioValueAnalysis;
damigroupinc commented 3 years ago

I cant find solution for this