xiaocong / uiautomator Goto Github PK
View Code? Open in Web Editor NEWPython wrapper of Android uiautomator test tool.
License: MIT License
Python wrapper of Android uiautomator test tool.
License: MIT License
Hi xiaocong, I'm using your wrapper recently. It works well except watcher. When a test case that maybe less than 15 minutes, the watcher works well. But If I run a long-time case, the watcher sometimes doesn't work. Do you know why? Please let me know, thanks!
was just trying to push a file using d.server.adb.cmd on Windows , i get into the following error , what is the command does python execute so that it shows adb help as error.
cmd_line:['D:\Work\adt-bundle-windows\sdk\platform-tools\adb.exe', 'devices']
cmd_line:['D:\Work\adt-bundle-windows\sdk\platform-tools\adb.exe', '-s', u'6B1C00001400B01B', 'push idle.xml /data/tmp/inbox']
('', 'Android Debug Bridge version 1.0.31\r\n\r\n -a - directs adb to listen on all interfaces for a connection\r\n -d - directs command to the on
ly connected USB device\r\n returns an error if more than one USB device is present.\r\n -e - directs command to the only running emulator.\r
\n returns an error if more than one emulator is running.\r\n -s - directs command to the device or emulator with the given\r\n
etc...
hi, dear xiaocong
when running execution through jsonrpc, user is unable to use ui-automator viewer to design next case step or run adb shell uiautomator runtest from terminal, shall we support another kind of mode --- case design mode, it will permit user to use ui-automator command.
Error logs:
INSTRUMENTATION_RESULT: shortMsg=java.lang.IllegalStateException
INSTRUMENTATION_RESULT: longMsg=UiAutomationService android.accessibilityservice.IAccessibilityServiceClient$Stub$Proxy@6a64d4a8already registered!
INSTRUMENTATION_CODE: 0
on window OS:
adb not found even though set the ANDROID_HOME
the ADB file name should be:
$ANDROID_HOME/platform-tools/adb.exe
Tried using
d.server.adb.raw_cmd('-s 12250522501812 shell logcat > 1.log').communicate()
But this command stuck while executing. Any idea
Any one has better solution to capture adb logcat while running test script?
Hi
In pic, there is only one node named "RelativeLayout" and the bounds attribute of this node is [0,75] to [1080,1920].when I got info from this UI object with command (device(className="android.widget.RelativeLayout").info) and its bounds attribute from result is [0,0] to [1080,1920].I think it didnt select right object. Did I miss something?
I am automating an app called 0xBenchmark. It has two UIs with text set to "2D" but one is clickable and the other one is not.
Hi Xiaocong
When I write d(text="2D", clickable=True).click(), it seems it picks the first instance of the UI with text="2D" which in fact is not clickable (I verified this using uiautomatorviewer)
I also tried checkable and focusable and both work correctly and it is able to pick the right UI but it seems clickable search criteria doesn't work.
Best regards
It takes 1 second to establish tcp connection in windows.
Request Count: 1
Bytes Sent: 257 (headers:179; body:78)
Bytes Received: 204 (headers:131; body:73)ACTUAL PERFORMANCE
ClientConnected: 17:31:57.413
ClientBeginRequest: 17:31:57.418
GotRequestHeaders: 17:31:57.418
ClientDoneRequest: 17:31:57.418
Determine Gateway: 0ms
DNS Lookup: 1ms
TCP/IP Connect: 1001ms
HTTPS Handshake: 0ms
ServerConnected: 17:31:58.422
FiddlerBeginRequest: 17:31:58.422
ServerGotRequest: 17:31:58.422
ServerBeginResponse: 17:31:58.443
GotResponseHeaders: 17:31:58.443
ServerDoneResponse: 17:31:58.446
ClientBeginResponse: 17:31:58.446
ClientDoneResponse: 17:31:58.446Overall Elapsed: 0:00:01.028
watchers registration sequence
d.watcher("alert_checkbox")...
d.watcher("alert_cancel")...
d.watcher("alert_ok")...
watchers calling sequence
d.watcher("alert_ok")...
d.watcher("alert_cancel")...
d.watcher("alert_checkbox")...
Is there any way to execute watchers in same sequence as they are dependents on each other
Hey there,
What is the purpose of bundle.jar and uiautomator-stub.jar?
If I want to change Server code, how to compile these two jars myself?
P.S.
I want to add Watcher to take screenshot by any testcase failure. I will add in the jsonserver code and then compile it to jar and use it uiautomator.py
Hi xiacong,
"adb shell uiautomator events " is not working while executing the testcases using UIautomator. Is there any way where I can get the uiautomator events?
Thanks
Sridhar
I use uiautomator 0.1.27
On Ubuntu 11.10, using Python 2.7 and uiautomator 1.16, the following error is encountered:
usrlib2.URLError:<urlopen error [Errno -2] Name or service not known
Insight/assistance on what the issue is and how to resolve would be greatly appreciated.
Hi @xiaocong
We have an android.webkit.WebView that has an html passed through to it. On it's properties, "text" and "content-desc" are bank but the correct text has been displayed on the screen. How can we retrieve the html passed to it or retrieve the visible text?
When I do a object.info on this object, this it what I get:-
"{'bounds': {'right': 465, 'bottom': 260, 'top': 194, 'left': 15}, 'className': None, 'longClickable': True, 'selected': False, 'clickable': True, 'contentDescription': '', 'checkable': False, 'checked': False, 'chileCount': 0, 'text': '', 'packageName': 'za.co.fnb.connect.itt', 'visibleBounds': {'right': 465, 'bottom': 260, 'top': 194, 'left': 15}, 'scrollable': False, 'focusable': True, 'focused': False, 'enabled': True}"
Here is the IU Automator Viewer screenshot
Hi,
I am getting the RPC server not started error, upon running Uiautomator python scripts. I am getting this error only my ubuntu system. When I connect same device to another ubuntu system, the Uiautomator script runs fine.
Problem seems like the jsonrpc server is not starting. Even tried to start in manually as mentioned in the FAQs, but its doesnt seem to work.
Please find the logs below:
https://gist.github.com/sush35/0e378ac6c6eddbcb199a#file-manual-server-start-logs
Thanks!
Hello I am new to this...I am seeing issue Import Error when running one of the test under test folder. No module named mock.
Handler is not calling if UI obj is not found using exists, but works fine with click. But watcher works fine for both.
Hi,
I am running this on my Nexus 7. Volume_mute is not working. Volume_up and down are working as expected.
Volume_mute command output is true but it is not reflecting on device.
uiautomator version: "0.1.26"
Android OS version: 4.1.1
d(text='Manual').info
{u'contentDescription': u'', u'checked': False, u'scrollable': False, u'text': u'Manual', u'packageName': u'com.android.settings', u'selected': False, u'enabled': True, u'bounds': {u'top': 249, u'left': 778, u'right': 1404, u'bottom': 282}, u'className': None, u'focusable': False, u'focused': False, u'clickable': False, u'checkable': False, u'chileCount': 0, u'longClickable': False, u'visibleBounds': None}
Dear xiaocong
I need some interface to call android api to test android system ,it will save a lot of
scripting work, for example , if I want to test phone call function , I have to write script
step by step to dial a MO call(press home=>go to dial pad=>input dial number=>make call). but if there is a api like "bool CallPhone(string phoneNo)" ,
then I only need to call this api directly. and I will work only all android phone .
Do you have any idea to develope this , I need some api like:
bool CallPhone(string phoneNo)
bool CallPhone(string phoneNo)
int GetCallState()
bool OpenUrl(string url)
bool SMS_Send (string phoneNo, string content)
bool MMS_Send (string phoneNo, string subject, string body,string type,string attachmentPath)
with WIN7 64bit PC and Python2.7.6 installed
when download the source and install by running setup.py install.
show this error:
E:\MTBF\外部工具\GoogleProject\uiautomator\uiautomator-master-xiaocong\uiautomat
or-master>E:\MTBF\外部工具\GoogleProject\uiautomator\uiautomator-master-xiaocong
\uiautomator-master\setup.py install
Traceback (most recent call last):
File "E:\MTBF\外部工具\GoogleProject\uiautomator\uiautomator-master-xiaocong\u
iautomator-master\setup.py", line 4, in
import uiautomator
File "E:\MTBF\外部工具\GoogleProject\uiautomator\uiautomator-master-xiaocong\u
iautomator-master\uiautomator.py", line 25, in
import urllib3
ImportError: No module named urllib3
Traceback (most recent call last):
File "/home/wanshuang/code_review_xiuhua/otc_qa_tools-ata/tests/samples/soundrecord.py", line 47, in tearDown
g_common_obj.stop_exp_handle()
File "/home/wanshuang/code_review_xiuhua/otc_qa_tools-ata/tests/utils/common.py", line 84, in stop_exp_handle
self.get_device().watchers.remove()
File "/usr/local/lib/python2.7/dist-packages/uiautomator-0.1.27-py2.7.egg/uiautomator.py", line 574, in remove
obj.server.jsonrpc.removeWatcher(name)
File "/usr/local/lib/python2.7/dist-packages/uiautomator-0.1.27-py2.7.egg/uiautomator.py", line 362, in wrapper
return _method_obj(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/uiautomator-0.1.27-py2.7.egg/uiautomator.py", line 98, in call
result = urllib2.urlopen(req, timeout=self.timeout)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1180, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 371, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
d(**A).from_parent(**B)
means from A
's parent find its child B
d(**A).child_selector(**B)
means from A
find its child B
But we can not use like d(**A).from_parent(**B).child_selector(**C)
, which means from A
's parent find its child B
, and then find'sB
's child C
.
It's a design issue.
On some devices, adb shell ps -C uiautomator
prompts an error.
d.click(805,805) command crashes android.
But the same command getDevice().click(805,805) works.
ro.secure=1
ro.debuggable=1
D/UIAutomatorStub( 1668): URI: /jsonrpc/0, Method: POST, Header: {content-type=application/json, user-agent=Python-urllib/2.6, connection=close, host=localhost:9008, accept-encoding=identity, content-length=78}, parms, {{"jsonrpc": "2.0", "method": "ping", "id": "2aad0a5903032a49fefe812a06e658e2"}=, NanoHttpd.QUERY_STRING={"jsonrpc": "2.0", "method": "ping", "id": "2aad0a5903032a49fefe812a06e658e2"}}, files: {}
W/ResourceType( 845): No known package when getting name for resource number 0x9b060000
W/ResourceType( 845): No known package when getting name for resource number 0x9b050001
W/ResourceType( 845): No known package when getting name for resource number 0x9b040002
W/ResourceType( 845): No known package when getting name for resource number 0x9b020004
W/ResourceType( 845): No known package when getting name for resource number 0x9b010005
W/ResourceType( 845): No known package when getting name for resource number 0x9b000006
W/ResourceType( 845): No known package when getting name for resource number 0x9c030000
W/ResourceType( 845): No known package when getting name for resource number 0x9c020000
I/QueryController( 1668): Matched selector: UiSelector[] <<==>> [android.view.accessibility.AccessibilityNodeInfo@7442; boundsInParent: Rect(0, 0 - 1920, 1104); boundsInScreen: Rect(0, 0 - 1920, 1104); packageName: com.android.launcher; className: android.widget.FrameLayout; text: null; contentDescription: null; viewIdResName: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; enabled: true; password: false; scrollable: false; [ACTION_SELECT, ACTION_CLEAR_SELECTION, ACTION_ACCESSIBILITY_FOCUS]]
D/UIAutomatorStub( 1668): URI: /jsonrpc/0, Method: POST, Header: {content-type=application/json, user-agent=Python-urllib/2.6, connection=close, host=localhost:9008, accept-encoding=identity, content-length=101}, parms, {{"params": [805, 805], "jsonrpc": "2.0", "method": "click", "id": "5ce39999f62f14da963de8e7156b114b"}=, NanoHttpd.QUERY_STRING={"params": [805, 805], "jsonrpc": "2.0", "method": "click", "id": "5ce39999f62f14da963de8e7156b114b"}}, files: {}
D/InteractionController( 1668): clickNoSync (805, 805)
E/InputEventReceiver( 542): Exception dispatching input event.
E/MessageQueue-JNI( 542): Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI( 542): java.lang.NullPointerException
E/MessageQueue-JNI( 542): at com.android.internal.widget.PointerLocationView.addPointerEvent(PointerLocationView.java:552)
E/MessageQueue-JNI( 542): at com.android.internal.policy.impl.PhoneWindowManager$PointerLocationInputEventReceiver.onInputEvent(PhoneWindowManager.java:310)
E/MessageQueue-JNI( 542): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182)
E/MessageQueue-JNI( 542): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MessageQueue-JNI( 542): at android.os.MessageQueue.next(MessageQueue.java:132)
E/MessageQueue-JNI( 542): at android.os.Looper.loop(Looper.java:124)
E/MessageQueue-JNI( 542): at android.os.HandlerThread.run(HandlerThread.java:61)
W/dalvikvm( 542): threadid=12: thread exiting with uncaught exception (group=0x41592700)
E/AndroidRuntime( 542): *** FATAL EXCEPTION IN SYSTEM PROCESS: UI
E/AndroidRuntime( 542): java.lang.NullPointerException
E/AndroidRuntime( 542): at com.android.internal.widget.PointerLocationView.addPointerEvent(PointerLocationView.java:552)
E/AndroidRuntime( 542): at com.android.internal.policy.impl.PhoneWindowManager$PointerLocationInputEventReceiver.onInputEvent(PhoneWindowManager.java:310)
E/AndroidRuntime( 542): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182)
E/AndroidRuntime( 542): at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime( 542): at android.os.MessageQueue.next(MessageQueue.java:132)
E/AndroidRuntime( 542): at android.os.Looper.loop(Looper.java:124)
E/AndroidRuntime( 542): at android.os.HandlerThread.run(HandlerThread.java:61)
I/Process ( 542): Sending signal. PID: 542 SIG: 9
It's on Windows 7 32bit and python2.7.
Not sure the root cause, but likely the server was started actually, because when I open another python console, and it worked well.
Code:
self.d.server.adb.raw_cmd("root").communicate()
subprocess.Popen('adb nodaemon wait-for-device'.split(), stdout=subprocess.PIPE).communicate()
self.d.server.adb.raw_cmd("reboot").communicate()
subprocess.Popen('adb nodaemon wait-for-device'.split(), stdout=subprocess.PIPE).communicate()
#time.sleep(10)
self.d(packageName="android").wait.exists(timeout=9000)
Error:
Traceback (most recent call last):
File "test_reboot.py", line 34, in testMultiReboot
self.reboot()
File "test_reboot.py", line 28, in reboot
self.d(packageName="android").wait.exists(timeout=9000)
File "/home/git/work/uiautomator/uiautomator.py", line 397, in call
return AutomatorDeviceObject(self, Selector(**kwargs))
File "/home/git/work/uiautomator/uiautomator.py", line 809, in init
super(AutomatorDeviceObject, self).init(device, selector)
File "/home/git/work/uiautomator/uiautomator.py", line 637, in init
self.jsonrpc = device.server.jsonrpc
File "/home/git/work/uiautomator/uiautomator.py", line 319, in jsonrpc
self.start()
File "/home/git/work/uiautomator/uiautomator.py", line 337, in start
raise IOError("RPC server not started!")
IOError: RPC server not started!
But after un-commenting time.sleep(), i do not see this issue, Does RPC server start after few seconds after reboot?
In class Adb, the function forward_list will return the correct forward port list on OS 'posix'.
My working environment is on Windows 7 64 bit.
The function will only return empty list and thus the AutomatorServer will establish a new adb forward port disregarding the already existed ones.
I added 'nt' in the if condition and it returns the correct list.
I wonder why restricting the function to OS 'posix', is there any other concern I don't know?
Thanks.
When using long_click() function, It is getting clicked, Need to add delay in long press case.
it would be better if we add delay parameter to the function , so that long click of any object will work fine.
while installing on python2.6 , got the following error.
pip install uiautomator
Downloading/unpacking uiautomator
Running setup.py egg_info for package uiautomator
Traceback (most recent call last):
File "", line 13, in
File "/home/vgm368/build/uiautomator/setup.py", line 4, in
import uiautomator
File "uiautomator.py", line 151
kwargs = {k: self[k] for k in self if k not in [self.__mask, self.__childOrSibling, self.__childOrSiblingSelector]}
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 13, in
File "/home/vgm368/build/uiautomator/setup.py", line 4, in
import uiautomator
File "uiautomator.py", line 151
kwargs = {k: self[k] for k in self if k not in [self.__mask, self.__childOrSibling, self.__childOrSiblingSelector]}
^
SyntaxError: invalid syntax
Command python setup.py egg_info failed with error code 1
Storing complete log in ./pip-log.txt
This is mainly an FYI as I don't know if this is fixable or if the requirements should be officially non-2.4 and below. When trying to install uiautomator with Python 2.14 this is received:
C:\Users\Mbadmin\Downloads\uiautomator-0.1.27>c:\Python24\python.exe setup.py
Traceback (most recent call last):
File "setup.py", line 4, in ?
import uiautomator
File "C:\Users\Mbadmin\Downloads\uiautomator-0.1.27\uiautomator.py", line 200
top = rect1["top"] if rect1["top"] > rect2["top"] else rect2["top"]
^
SyntaxError: invalid syntax
Hope this helps!
In API level 16 (android 4.1), the method d().count
will timeout.
run
d.info
throw exception
File "uiautomator.py", line 264, in jsonrpc
self.start()
File "uiautomator.py", line 281, in start
files = self.download_and_push()
File "uiautomator.py", line 254, in download_and_push
adb.cmd("push", filename, "/data/local/tmp/").wait()
File "uiautomator.py", line 194, in cmd
cmd_line = ["-s", self.device_serial()] + list(args)
File "uiautomator.py", line 205, in device_serial
devices = self.devices()
File "uiautomator.py", line 219, in devices
out = self.raw_cmd("devices").communicate()[0].decode("utf-8")
File "uiautomator.py", line 199, in raw_cmd
cmd_line = [self.adb()] + list(args)
File "uiautomator.py", line 176, in adb
if "ANDROID_HOME" in os.environ:
RuntimeError: maximum recursion depth exceeded while calling a Python object
I'm running a AVD using the latest google Atom x86 image. When trying to run uiautomator scrips i'm running into issues. When using a live device i'm not seeing this, any ideas?
When running:
adb shell uiautomator runtest bundle.jar uiautomator-stub.jar -c com.github.uiautomatorstub.Stub
I get this warning and then the cmd prompt hangs. No commands are working for UIAutomator after this.
WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.github.uiautomatorstub.Stub:
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=testUIAutomatorStub
INSTRUMENTATION_STATUS: class=com.github.uiautomatorstub.Stub
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
Hi
I had some issues to start RPC server on win7.
And I refered issue #7 did some steps blow.
2.adb shell getprop ro.build.version.release
4.1.2
3.adb shell ps -C uiautomator
USER PID PPID VSIZE RSS WCHAN PC NAME
shell 10669 10667 651052 30640 ffffffff 401c0ce4 S uiautomator
4.adb logcat -d after error occurred and mailed to you.
Hi,
I am newbie on Android so apologies for my question that may be dumb. I am trying to run the jsonrcp server on Android device using "adb shell uiautomator runtest uiautomator-stub.jar bundle.jar -c com.github.uiautomatorstub.Stub" but I am getting the following:-
INSTRUMENTATION_RESULT: longMsg=Didn't find class "com.github.uiautomatorstub.Stub" on path: /system/framework/android.test.runner.jar:/system/framework/uiautomator.jar::/data/local/tmp/uiautomator-stub.jar:/data/local/tmp/bundle.jar
INSTRUMENTATION_CODE: 0
I have tried to follow all the steps on the instruction. I am not sure what I have missed. Please help, how can I solve this?
Hi:
I had problems to start the RPC server.
from uiautomator import device as d
d.info
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 412, in info
return self.server.jsonrpc.deviceInfo()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 319, in jsonrpc
self.start()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 337, in start
raise IOError("RPC server not started!")
IOError: RPC server not started!
Did i forgot some steps?
As per your instruction i had installed uiautomator in my ubuntu12.04 machine using below command.
pip install uiautomator
I had android SDK path in bashrc file also.
export ANDROID_HOME=~/adt-bundle-linux-x86_64-20130917/sdk/
After above steps i had open terminal and opened python and executed below commands
python
Python 2.7.3 (default, Apr 10 2013, 06:20:15)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from uiautomator import device as d
d.info
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 381, in info
return self.server.jsonrpc.deviceInfo()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 280, in jsonrpc
self.start()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 310, in start
raise IOError("RPC server not started!")
IOError: RPC server not started!
exit()
I am getting RPC server not found can you please suggest any thing need be configure in my Ubuntu machine to use python wrapper for uiautomator.
Hi @xiaocong
I am a heavy user of this and here is one challenge I have discovered,
There are certain objects on Android that have text in them but the text is not on the "text" and "contentDescription" field (see attachment). I suspect there might be more object that behaves like this one. However, there maybe a possible solution to this. I don't know complex it maybe from your side to create a function like "getvisible text".
Here is how it can work:
I know "ocr" is far from perfect but at least it will retrieve some text.
Device Used: Galaxy S5 4.4.2
if d(text="Calendar").click() works why can't d(text="Calendar").long_click() work.
d(text="Calendar").long_click() throws an error
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/uiautomator/init.py", line 71, in call
return self.func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/uiautomator/init.py", line 844, in _long_click
x = (bounds["left"] + bounds["right"])/2
TypeError: 'NoneType' object has no attribute 'getitem'
It can be supported right? particularly useful to get context sensitive menu popped up.
Can we communicate two devices with single script sending one command to call to second device and in the second device can we receive the call, with same one script using this framework.
I know using python framework for android we can achieve this by connecting one device as master and another device as slave.
d.dump('screen.xml')
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\uiautomator.py", line 401, in dump
device_file = self.server.jsonrpc.dumpWindowHierarchy(True, "dump.xml")
File "C:\Python27\lib\site-packages\uiautomator.py", line 79, in call
(jsonresult["error"]["code"], jsonresult["error"]["message"]))
Exception: Error response. Error code: 0, Error message: UiAutomationService not
connected. Did you call #register()?
testerhome.com
我们也在研究uiautomator相关的东西, 专注于做移动测试.
感兴趣可以来我们论坛交流
我们使用的是appium
init home menu, and find Settings app by de(scrollable=True).scroll.horiz.to(text="Settings"), if [Settings] in the first screen before scrolling, it will return true, otherwise return false.
In class Adb, function forward_list returns the correct tcp forward port number list only on OS 'posix'.
My working environment is on Windows 7 64 bit.
The function will only return a empty list, thus I will establish another adb forward port to device disregarding the already existed port forwarding.
I wonder why restricting the function to OS 'posix', is there other concern I don't know?
Thanks.
Currently, Watcher can trigger defined simple action, e.g, click when condition match. However, sometimes, we expect do more complex action. It is better provide a callback interface for watcher, thus user can define whatever customized action in a function.
Hi, I have following error on 'd.info()'
echo 'from uiautomator import device as d;print(d.info)' | python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 476, in info
return self.server.jsonrpc.deviceInfo()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 369, in wrapper
server.start()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 385, in start
files = self.download_and_push()
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 342, in download_and_push
self.download(filename, url)
File "/usr/local/lib/python2.7/dist-packages/uiautomator.py", line 350, in download
res = urllib2.urlopen(url)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1153, in do_open
h = http_class(host, timeout=req.timeout) # will parse host:port
File "/usr/lib/python2.7/httplib.py", line 1164, in __init__
source_address)
File "/usr/lib/python2.7/httplib.py", line 704, in __init__
self._set_hostport(host, port)
File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: 'aport'
how can I fix this?
Hi Xiaocong,
Can you please update the android-json-rpc jars with latest nanohttpd code ?
if it is not possible, let us know what are the files to take care to do that.
Reason for this, there are multiple update happened in the nanohttpd project related to connection issues.
Thanks
Sridhar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.