You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I attempt to assert a specific index of an element is not present and the element is not present I except the assertion to pass, but instead I receive error
Error Element Element [name=@additionalInterestRowDetail[1]] not found. An element could not be located on the page using the given search parameters. ✖ NightwatchAssertError Expected element @additionalInterestRowDetail <[fieldref="AdditionalOtherInterestInput.Description"]> to not be present - element was not found - expected "not present" but got: "error while locating the element" (10ms)
Steps to reproduce
Use .expect.element({selector: 'some selector', index: 1}).to.not.be.present in a test where the selector is present on the page, but only one instance of it is present...so there would be an index 0 but not index 1. The scenario I am trying to verify is that there aren't more than one of this particular item on the page.
Instead of passing the check that it is not present the test fails because it can't locate that selector at index 1. This works fine without using an index.
→ Running command: expect.element ({name, __index, __selector, locateStrategy, pseudoSelector, parent, resolvedElement, abortOnFailure, suppressNotFoundErrors, timeout...})
Request POST /session/176def76257ef8a44ce7db8a5fcb4db0/elements
{
using: 'css selector',
value: '[fieldref="AdditionalOtherInterestInput.Description"]'
}
Response 200 POST /session/176def76257ef8a44ce7db8a5fcb4db0/elements (6ms)
{
value: [
{
'element-6066-11e4-a52e-4f735466cecf': '30D0DFA34670C2A3575ECD64283B90F2_element_205'
}
]
}
Error
Element Element [name=@additionalInterestRowDetail[1]] not found. An element could not be located on the page using the given search parameters.
✖ NightwatchAssertError
Expected element @additionalInterestRowDetail <[fieldref="AdditionalOtherInterestInput.Description"]> to not be present - element was not found - expected "not present" but got: "error while locating the element" (12ms)
Nightwatch Configuration
n/a
Nightwatch.js Version
2.6.21
Node Version
18
Browser
Chrome 114
Operating System
Windows 11
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Description of the bug/issue
When I attempt to assert a specific index of an element is not present and the element is not present I except the assertion to pass, but instead I receive error
Steps to reproduce
Use
.expect.element({selector: 'some selector', index: 1}).to.not.be.present
in a test where the selector is present on the page, but only one instance of it is present...so there would be an index 0 but not index 1. The scenario I am trying to verify is that there aren't more than one of this particular item on the page.myPageObject.expect.element({selector: '@validSelectorAlias',
index: 1}).to.not.be.present;
Instead of passing the check that it is not present the test fails because it can't locate that selector at index 1. This works fine without using an index.
Sample test
Command to run
Verbose Output
Nightwatch Configuration
Nightwatch.js Version
2.6.21
Node Version
18
Browser
Chrome 114
Operating System
Windows 11
Additional Information
No response
The text was updated successfully, but these errors were encountered: