Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpath relative to element does not work #195

Open
hellozyemlya opened this issue Feb 21, 2023 · 2 comments
Open

xpath relative to element does not work #195

hellozyemlya opened this issue Feb 21, 2023 · 2 comments

Comments

@hellozyemlya
Copy link

It seems like that relative xpath does not work:

        console.log("Trying Relative xpath")
        console.log(await element.findElements("xpath", `.//*[@identifier="Ident"]`))
        console.log("----")

results it in same requests to webdriver as browser.findElements("xpath", //*[@Identifier="Ident"])

logs:

2023-02-21T19:19:20.248Z INFO webdriver: [POST] http://127.0.0.1:4723/session/37fc0294-0d9e-4950-a252-b1ad7bae6dca/elements
2023-02-21T19:19:20.249Z INFO webdriver: DATA { using: 'xpath', value: './/*[@identifier="Ident"]' }
2023-02-21T19:19:20.477Z INFO webdriver: RESULT [
  {
    'element-6066-11e4-a52e-4f735466cecf': '0D4E28E9-CF9F-4D71-A256-9DB398A3A361',
    ELEMENT: '0D4E28E9-CF9F-4D71-A256-9DB398A3A361'
  },
  {
    'element-6066-11e4-a52e-4f735466cecf': 'F480DFA1-4221-4154-9007-F0C11FBD5B1A',
    ELEMENT: 'F480DFA1-4221-4154-9007-F0C11FBD5B1A'
  }
]

If that is expected, is that possible to query child elements by identifier in other way?

@hellozyemlya
Copy link
Author

Maybe I am using findElements in incorrect way, if I replace findElements to $$, then everything works fine...

@mykola-mokhnach
Copy link
Contributor

The provided information is not enough to make any assumptions. Please provide the page source and full server logs for the above client API invocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants