Appium xpath attribute attribute text

The physical device of the smart phone Android 4.4.4is on the USB cable, it is ADBturned on. Attempts are being made to automate a hybrid Android application on this device via Appium(Java).

We are having problems matching elementary discovery and access.

For instance:

List<WebElement> buttons = driver.findElements(By.xpath("//android.widget.Button[@text='Something']"));

System.out.println("Found " + buttons.size() + " buttons.");

for ( WebElement el : buttons ) {
         System.out.println(el.getAttribute("text"));
}

The button (1) is open. The found button obviously has a "text" attribute containing "Something". However, when you try to print the contents of the text attribute, the result is empty; just returning a string.

Also, when a method is called .click();, the clicked element is not the element that is found. In fact, according to the app's xml UI, the element clicked is not even android.widget.Button.

, ?

.

+4
1

, , , sendkeys, . . , context webview.

0

All Articles