CodeceptJS
CodeceptJS copied to clipboard
Element is not <select> errors when using I.selectOption on valid select element
What are you trying to achieve?
Attempting to use I.selectOption()
using Playwright
What do you get instead?
Element is not <select>
error even though the element exists on the page and is indeed a select.
Digging a bit deeper and looking at the implementation of the async selectOption(select, option)
function, it seems like on line 1477 of lib/helper/Playwright.js the tag name that is getting returned by this code fragment should be uppercase, for me the tagName is lowercase.
Provide console output if related. Use
--verbose
mode for more details.
Element is not <select>
at Playwright.selectOption (node_modules/codeceptjs/lib/helper/Playwright.js:1479:13)```
> Provide test source code if related
```js
I.selectOption("select[name='group_id']", "10001");
Details
- CodeceptJS version: 3.3.4
- NodeJS Version:
- Operating System: OSX
- puppeteer || webdriverio || testcafe version (if related):
"playwright": "^1.23.4"
- Configuration file:
exports.config = {
output: './output',
helpers: {
Playwright: {
url: process.env.XXXX,
show: false,
browser: 'chromium',
ignoreHTTPSErrors: true,
}
},
include: {
I: './steps_file.js',
loginPage: './pages/login.js'
},
mocha: {},
bootstrap: null,
timeout: null,
teardown: null,
hooks: [],
gherkin: {
features: './features/*.feature',
steps: ['./step_definitions/startup.step.js', './step_definitions/lobby.step.js']
},
plugins: {
autoDelay: {
enabled: false
},
screenshotOnFail: {
enabled: true
},
tryTo: {
enabled: true
},
retryFailedStep: {
enabled: false
},
retryTo: {
enabled: true
},
eachElement: {
enabled: true
},
pauseOnFail: {},
autoLogin: {
enabled: false,
saveToFile: false,
inject: 'wcLogin',
users: {
ci: {
// below functions defined in `steps_file.js`, see https://codecept.io/pageobjects/#actor
wcLogin: (I) => I.wcLogin(),
wcCheck: (I) => I.wcCheckLoggedIn(),
caLogin: (I) => I.caLogin(),
caCheck: (I) => I.caCheck()
}
}
}
},
stepTimeout: 0,
stepTimeoutOverride: [{
pattern: 'wait.*',
timeout: 0
},
{
pattern: 'amOnPage',
timeout: 0
}
],
tests: './*_test.js',
name: 'acceptance'
}