Closed reallymello closed 2 days ago
This is happening because of a mistake in the example itself. In the example, we've put browser.element
statement before the browser.url
call, so browser.element
would be placed in the Nightwatch queue before browser.url
and run in the same order.
This creates a problem because it would not be able to find the required element on an empty page.
(Also, the piece of code throwing this error is actually part of the Selenium codebase. And it was only happening because the element
argument passed to the Select
constructor wasn't what it expected. It expected a WebElement
to be passed but we actually passed Nightwatch's own ScopedWebElement
. So, the check Selenium is missing is to verify if the passed element
is even an instance of WebElement
or not.)
Description of the bug/issue
When I call
npx nightwatch examples\tests\selectElement.js
I expect the test to pass, but instead I receiveThere is no null check on tagName in select.js before it tries to access .toLowerCase() causing an unhandled rejection
Steps to reproduce
npx nightwatch examples\tests\selectElement.js
This is the test included in the Nightwatch repository
Sample test
Command to run
Verbose Output
Nightwatch Configuration
No response
Nightwatch.js Version
2.3.6
Node Version
20
Browser
Firefox
Operating System
Windows 11
Additional Information