1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

workloads/androbench: Fix for devices running Android 8.1

On some devices running Android 8.1 the start benchmark button was
failing to be clicked, this is a workaround to click on the coordinates
of the button instead of the UiObject iteslf.
This commit is contained in:
Marc Bonnici 2018-07-10 14:41:19 +01:00 committed by setrofim
parent ae4fdb9e77
commit 1b58390ff5

View File

@ -18,6 +18,7 @@ package com.arm.wa.uiauto.androbench;
import android.app.Activity;
import android.os.Bundle;
import android.graphics.Rect;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObjectNotFoundException;
@ -59,7 +60,8 @@ public class UiAutomation extends BaseUiAutomation {
} else {
UiObject bench =
mDevice.findObject(new UiSelector().resourceIdMatches("com.andromeda.androbench2:id/btnStartingBenchmarking"));
bench.click();
Rect bounds = bench.getBounds();
mDevice.click(bounds.centerX(), bounds.centerY());
}
UiObject btn_yes= mDevice.findObject(selector.textContains("Yes")
.className("android.widget.Button"));