On my page, I have the following HTML DOM structure and I am using Nightwatch to write test cases.
<td class="GPNWDJGHV" id="gwt-debug-MenuItem/mongo-true">Mongo Extension</td>
When trying to select the element using its ID with the '#' symbol, it doesn't find the element:
.waitForElementVisible('#gwt-debug-MenuItem/mongo-true', 10000)
But if I use the classname instead, it works as shown below:
.waitForElementVisible('GPNWDJGHV', 10000)
The only difference is that the ID contains a special character '/'. Could this be the reason why Nightwatch cannot pick it up? How can we handle IDs with special characters?
EDIT1
I attempted to escape the '/' in the ID like so:
.waitForElementVisible('#gwt-debug-MenuItem\/mongo-true', 10000)
However, it still does not work. Surprisingly, this selector works in CSS. The behavior seems different when using Nightwatch.