Open Adrian-Tamas opened 4 years ago
Workaround for anyone facing this issue would be to get the object property from obj key since the name is random:
let jsonWebElementId = jsonWebElement[Object.keys(jsonWebElement)[0]];
I don't think this is a bug, but this is how webdriver behaves. The web element identifier is the string constant "element-6066-11e4-a52e-4f735466cecf". See: https://www.w3.org/TR/webdriver/#elements
Pure Nightwatch does not retrieve the element in the same way. Only the Nightwatch-Api returns the element this way, while Nightwatch returns it with the name of "ELEMENT" so that it easy to access the content. And while yes, that is how an identifier looks, it should not be returned as a key in a object but rather as a value to an easy to identify key (like ELEMENT for e.g.)
The element/elements command returns different structures for the selenium element between nightwatch and nightwatch-api and you can no longer use them to there full potential
Expected Behavior
Nightwatch object returned { "ELEMENT": "0.26693227503345773-1" }
Current Behavior
Nightwatch-api object example { "element-6066-11e4-a52e-4f735466cecf": "f5ae481e-4855-4343-a0f6-00553f97b534" }
Steps to Reproduce (for bugs)
Example code: client -> nightwatch-api import
Because there no longer is an ELEMENT property you can read to get the id to use further protocol actions based on that like elementIdText can no longer be used
Your Environment