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

Unable to fetch children from desktop using Xpath #583

Closed
venkat2048 opened this issue Jan 30, 2019 · 3 comments
Closed

Unable to fetch children from desktop using Xpath #583

venkat2048 opened this issue Jan 30, 2019 · 3 comments
Assignees

Comments

@venkat2048
Copy link

Hi,

@timotiusmargo
I'm trying to get root desktop session and identify opened windows and written code as shown below:

        DesiredCapabilities DC = new DesiredCapabilities();
        DC.SetCapability("platFormName", "Windows");
        DC.SetCapability("app", "Root");
        DC.SetCapability("deviceName", "WindowsPC");
      
        session = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), DC);

        //For Line below it returns with windows list whose classname is 'Window'
        var openWindows = session.FindElementsByClassName("Window");

        Actual: //For Line below it returns NULL (Issue)
        openWindows = session.FindElementsByXPath("//*"); 

Expected: It should return all children under desktop

Please find the screenshots below:

Image1: Issue

image

Image2: Works with ClassName

image

@timotiusmargo
Copy link
Contributor

Hi @venkat2048,

Thanks for bringing it up. There is a known bug that causes the XPath element search to terminate early when it encounters duplicate runtimeId. For the time being you will need to use non XPath elements search until the issue is fixed.

@timotiusmargo
Copy link
Contributor

Hi @venkat2048,

In WinAppDriver v1.1.1 release, we properly handle the exception scenario where distinct elements share the same runtimeId. This issue prematurely terminate XPath element search in previous releases. Would you please give it a try?

@timotiusmargo timotiusmargo self-assigned this Mar 26, 2019
@shoaibmansoor
Copy link

@timotiusmargo I am able to reproduce it with v1.2.1 as well.

I can get page_source correctly and elements by other methods but find_elements_by_xpath doesn't work

Could you please look into this?

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

3 participants