Winium.Desktop icon indicating copy to clipboard operation
Winium.Desktop copied to clipboard

Not able to identify Element that does not have ID, Name & Class

Open suniti2302 opened this issue 7 years ago • 4 comments

Hi All, I am trying to identify list items that are present under a list . i Dentified the list item by using class name - ReadOnlyCollection<IWebElement> lists = driver.FindElements(By.ClassName("ListBox")); But the elements inside the list dont have a class name/name or ID. They have a control type - ControlType.ListItem. Culture: "(null)" AutomationId: "" LocalizedControlType: "list item" ClassName: "" ControlType: "ControlType.ListItem"

Can i identify the child items of the list by using this control type ?? I am stuck at this point and need this to be resolved to move forward :(

suniti2302 avatar Aug 25 '17 10:08 suniti2302

"Name: " also empty?

heilwood avatar Aug 28 '17 06:08 heilwood

Hey @suniti2302 : you may find element that does not contain AutomationId or className by making their xpath one way to make xpath is

driver.findElementByClassName("ListBox").click(); then String XPath = "//*[contains(@Name,'WhateverTheNameIs')]"; driver.findElementByXPath(XPath).click();

for further details on how to make xpath, please refer to the link below https://github.com/2gis/Winium.Desktop/issues/111

ahsanixc avatar Sep 06 '17 05:09 ahsanixc

Hi , I am trying to identify element for button, using UIspy and Inspector.exe But the elements inside the button don't have a class name/name or ID. How could I get the button click event ? I also tried with text() in xpath but no luck found to run without error (On button UI, I can see name with "New Project but using text() there error is shown no such element found ") Would be helpful if someone help here. Thanks in advance

varunkharche avatar Mar 21 '19 08:03 varunkharche

Hi Varun,

I am facing the same issue. Do you have any solution for the same? Thanks in advance.

KamarajuSahu avatar Sep 04 '19 12:09 KamarajuSahu