Winappdriver: driver.findElementByAccessibilityId Vs driver.findElementById

Created on 5 Oct 2017  路  4Comments  路  Source: microsoft/WinAppDriver

Using Java -
What's the difference between the driver.findElementByAccessibilityId Vs driver.findElementById/ driver.findElement(By.id(""))?

Can we reuse the selenium modules?
ex: driver.findElement(By.id(APPLICATION_NAME_ID)).click doesn't seems to work and however, the findElementByAccessibilityId seems to work.

Most helpful comment

@timotiusmargo thanks and this really helps!

All 4 comments

Hi @SanjeevKumarmn,

As described in our list of supported locators, Appium AccessibilityId refers to AutomationId of the UI element as shown in the inspect tool. ElementId or simply Id refers to the unique identifier of the element which in most cases is the RuntimeId of the UI element.

Note that non UIA compliant applications may contain elements with no RuntimeId. In such case, we will assign a unique GUID for the element so that further operation/actions can be performed on this element. Another query to find the same element in however, will result in a different GUID.

@timotiusmargo thanks and this really helps!

From accessibilityId how to get a text value?

@sachinDV Try to use the command below written in python.
variable = self.driver.find_element_by_accessibility_id("xxxxxx").text

Was this page helpful?
0 / 5 - 0 ratings