Skip to content

Commit dcda237

Browse files
committed
Issue dtmilano#72: view.type(str) too slow
- Version 4.9.0 - Fixed according to gdobra suggestion
1 parent f85e734 commit dcda237

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

AndroidViewClient/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup, find_packages
44

55
setup(name='androidviewclient',
6-
version='4.8.0',
6+
version='4.9.0',
77
description='''AndroidViewClient is a 100% pure python tool that
88
simplifies test script creation providing higher level operations and the ability of
99
obtaining the tree of Views present at any given moment on the device or emulator screen.

AndroidViewClient/src/com/dtmilano/android/viewclient.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@author: Diego Torres Milano
1919
'''
2020

21-
__version__ = '4.4.3'
21+
__version__ = '4.9.0'
2222

2323
import sys
2424
import warnings
@@ -943,13 +943,11 @@ class EditText(TextView):
943943

944944
def type(self, text):
945945
self.touch()
946-
time.sleep(1)
947-
for c in text:
948-
if c != ' ':
949-
self.device.type(c)
950-
else:
951-
self.device.press('KEYCODE_SPACE', adbclient.DOWN_AND_UP)
952-
time.sleep(1)
946+
time.sleep(0.5)
947+
escaped = text.replace('%s', '\\%s')
948+
encoded = escaped.replace(' ', '%s')
949+
self.device.type(encoded)
950+
time.sleep(0.5)
953951

954952
def backspace(self):
955953
self.touch()

0 commit comments

Comments
 (0)