Skip to content

Unable to fetch children from desktop using Xpath #583

@venkat2048

Description

@venkat2048

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions