Skip to content

Commit 0f69ef7

Browse files
committed
Use number-named buttons
1 parent f93204c commit 0f69ef7

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

AndroidViewClient/examples/click-button-by-text.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,17 @@
2121
from com.dtmilano.android.viewclient import ViewClient
2222

2323
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
24-
25-
26-
#package = 'com.example.i2at.tc'
27-
#activity = '.TemperatureConverterActivity'
28-
#componentName = package + "/" + activity
24+
2925
device = MonkeyRunner.waitForConnection(60, "emulator-5554")
3026
if not device:
3127
raise Exception('Cannot connect to device')
3228

33-
#device.startActivity(component=componentName)
3429
MonkeyRunner.sleep(5)
3530

3631
vc = ViewClient(device)
3732
vc.dump()
3833

39-
for bt in [ '1', '2', '3', '4', '5', '6' ]:
34+
for bt in [ 'One', 'Two', 'Three', 'Four', 'Five' ]:
4035
b = vc.findViewWithAttribute('text:mText', bt)
4136
if b:
4237
(x, y) = b.getXY()

0 commit comments

Comments
 (0)