I have a disabled select element in an html file which I would like to check using puppeteer that it is in fact disabled. Unfortunately the page.select method seems to ignore the lock on the field element. Here is a stripped down example.
<!DOCTYPE html>
<html>
<body>
<select id='dropdown' disabled>
<option value="op1">Option 1</option>
<option value="op2">Option 2</option>
</select>
</body>
</html>
Now if I open this index.html I cannot change the select as expected but when interfacing with puppeteer using the page.select method I can.
const puppeteer = require('puppeteer');
const fs = require('fs');
(async () => {
const browser = await puppeteer.launch( { headless: false} );
const page = await browser.newPage();
const content = fs.readFileSync('./index.html', 'utf8');
await page.setContent(content);
await page.select('#dropdown', 'op2');
})();
Now if I understand the puppeteer documentation correctly, then this should not result in the select option changing, but never the less it does. Am I missing something, or do I need to do something else in order to check that the element is locked.