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

Robot Framework + Appium absolute XPATH issue #571

Open
YouWhy opened this issue Jan 16, 2019 · 1 comment
Open

Robot Framework + Appium absolute XPATH issue #571

YouWhy opened this issue Jan 16, 2019 · 1 comment

Comments

@YouWhy
Copy link

YouWhy commented Jan 16, 2019

I am using Appium in Robot Framework to automate a Windows UWP application. In inspect.exe, the element I want to click is a Radio Button with name='QA' and the following are its ancestors:

Ancestors:  "FusionReg-MockUI" window
            "FusionReg-MockUI" window
            "Desktop 1" pane
           [ No Parent ]

I am using the following absolute xpath locator method to click it in Robot Framework script:

Click Element xpath=/Pane[@Name='Desktop${SPACE}1']/Window[@Name='FusionReg-MockUI']/Window[@Name='FusionReg-MockUI']/RadioButton[@Name='QA']

The above line fails with error 'Did not match any elements'.

however, if I use relative XPath it works!! Its very strange.

Click Element xpath=//RadioButton[@Name='QA']

I want to use absolute XPATH. What am I doing wrong?

I am not an expert in XPATH and I would really appreciate a solution, since I am doing some PoC work with Robot Framework + Appium + WinAppDriver for Windows App Automation.

Thanks.

@karniemi
Copy link

Just an note about your example - "//" is not "relative", but rather "recursive from current node":
Click Element xpath=//RadioButton[@Name='QA']

...but sorry no idea why the absolute path is not working. Maybe the double ancestor: FusionReg-MockUI" window causes it somehow (#583 discusses something about "duplicate runtimeId", though I don't know if there's a bug report or proper explanation about the underlying problem in that).

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

No branches or pull requests

2 participants