06
Jul

Get display text of label in Winium

We can interact with Labels in desktop application by using following code:

WebElement testElement = winiumdriver.findElement(By.xpath(“//*[contains(@Name,’Keys: ‘)]”));
String lblValue = testElement.getAttribute(“Name”);
System.out.println(lblValue);