Skip to content

Result returned by the client.elements and client.element command is incorrect #830

@Adrian-Tamas

Description

@Adrian-Tamas

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

          await client.url("https://nightwatchjs.org/guide");
            await client.elements("css selector", "a", function (res) {
                    res.value.forEach(function (jsonWebElement) {
                        let jsonWebElementId = jsonWebElement.ELEMENT;
                        client.elementIdText(jsonWebElementId, function (jsonElement) {
                            let text = jsonElement.value;
                            console.log("link text " + text);
                        });
                    });
                });

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

  • Version used: ^3.0.1
  • Browser Name and version: Firefox 72.0.1
  • Operating System and version (desktop or mobile): Windows 10
  • using nightwatch api in a mocha setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions