这是QT4A的Demo使用项目。
cd /path/to/project
pip install -r requirements.txt
cd /path/to/project
adb install demo.apk
cd /path/to/project
python manage.py runscript demotest/hello.py
Demo testcase for QT4A
这是QT4A的Demo使用项目。
cd /path/to/project
pip install -r requirements.txt
cd /path/to/project
adb install demo.apk
cd /path/to/project
python manage.py runscript demotest/hello.py
Traceback (most recent call last):
File "manage.py", line 24, in
ManagementTools().run()
File "C:\Users\yostar\PycharmProjects\untitled\venv\lib\site-packages\testbase\management.py", line 626, in run
cmds = self._load_cmds()
File "C:\Users\yostar\PycharmProjects\untitled\venv\lib\site-packages\testbase\management.py", line 579, in _load_cmds
cmds += self._load_cmd_from_module(sys.modules[name])
File "C:\Users\yostar\PycharmProjects\untitled\venv\lib\site-packages\testbase\management.py", line 602, in _load_cmd_from_module
cmds.sort(lambda x, y:cmp_func(x.name, y.name))
TypeError: sort() takes no positional arguments
请问这个问题你们有发现吗 ?
步骤2: 2、检查网页标题
GetControl
EvalScript
CRITICAL: run_test执行失败
Traceback (most recent call last):
File "D:\Python36\lib\site-packages\qt4a\andrcontrols.py", line 1702, in eval_script
return self._driver.eval_script(self.hashcode, frame_xpaths, script)
File "D:\Python36\lib\site-packages\qt4a\androiddriver\androiddriver.py", line 824, in eval_script
result = self.send_command(EnumCommand.CmdEvalScript, Control=control, Script=script, Frame=frame_xpaths)
File "D:\Python36\lib\site-packages\qt4a\androiddriver\androiddriver.py", line 504, in send_command
raise AndroidSpyError(result['Error'])
qt4a.androiddriver.util.AndroidSpyError: java.lang.RuntimeException: java.lang.RuntimeException: Get Field mAwContents Failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python36\lib\site-packages\testbase\testcase.py", line 701, in _thread_run
getattr(self._testcase, it)()
File "E:/QT4ADemoProj-master/demotest/webview.py", line 35, in run_test
demo_webpage = DemoWebPage(demo_webpanel.Controls["webview"])
File "D:\Python36\lib\site-packages\qt4w\webcontrols.py", line 1058, in init
if wait_for_ready: self.wait_for_ready()
File "D:\Python36\lib\site-packages\qt4w\webcontrols.py", line 1125, in wait_for_ready
if self.ready_state == 'complete': return
File "D:\Python36\lib\site-packages\qt4w\webcontrols.py", line 1100, in ready_state
return self.exec_script('document.readyState')
File "D:\Python36\lib\site-packages\qt4w\util.py", line 144, in wrap_func
ret = func(*args, **kwargs)
File "D:\Python36\lib\site-packages\qt4w\webcontrols.py", line 1147, in exec_script
return self._webdriver.eval_script(self._locator, script)
File "D:\Python36\lib\site-packages\qt4a\androiddriver\webdriver.py", line 2080, in eval_script
raise e
File "D:\Python36\lib\site-packages\qt4a\androiddriver\webdriver.py", line 2065, in eval_script
return super(AndroidWebDriver, self).eval_script(frame_xpaths, script)
File "D:\Python36\lib\site-packages\qt4w\webdriver\webdriver.py", line 412, in eval_script
raise e
File "D:\Python36\lib\site-packages\qt4w\webdriver\webdriver.py", line 395, in eval_script
return self._webview.eval_script(frame_xpaths, script)
File "D:\Python36\lib\site-packages\qt4a\andrcontrols.py", line 1759, in eval_script
return self.webview_impl.eval_script(frame_xpaths, script)
File "D:\Python36\lib\site-packages\qt4a\andrcontrols.py", line 1711, in eval_script
raise JavaScriptError(frame_xpaths, e.args[0])
qt4w.util.JavaScriptError: []java.lang.RuntimeException: java.lang.RuntimeException: Get Field mAwContents Failed
172.16.0.227:5555的截图:E:\QT4ADemoProj-master\demotest\WebViewTest_172.16.0.227_5555_1551148419.4499266.png
CRITICAL: post_test执行失败
Traceback (most recent call last):
File "D:\Python36\lib\site-packages\testbase\testcase.py", line 701, in _thread_run
getattr(self._testcase, it)()
File "E:\QT4ADemoProj-master\demolib\demotestbase.py", line 17, in post_test
super(DemoTestBase, self).post_test()
File "D:\Python36\lib\site-packages\qt4a\androidtestbase.py", line 83, in post_test
self._save_logcat()
File "D:\Python36\lib\site-packages\qt4a\androidtestbase.py", line 250, in _save_logcat
device.adb.save_log(log_path)
File "D:\Python36\lib\site-packages\qt4a\androiddriver\adb.py", line 442, in save_log
f.write('\n'.join(log_list))
UnicodeEncodeError: 'gbk' codec can't encode character '\u0402' in position 88914: illegal multibyte sequence
User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/M4B30X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/72.0.3626.105 Mobile Safari/537.36
步骤1: 1、登录Android demo
RESOURCE: acquire resource (res_type:android, res_group:None, condition:{}) successfully
Coolpad5890-a17c171e(Coolpad 5890 armeabi-v7a Android 4.1.2)
ENVIRONMENT: 申请 Android 设备成功:Coolpad 5890(Coolpad5890-a17c171e)
2020-07-02 01:36:09,655 123145336020992 Take screenshot failed: b"reloc_library[1306]: 20554 cannot locate '_ZN7android21SurfaceComposerClient17getBuiltInDisplayEi'...\nCANNOT LINK EXECUTABLE\n\x00"
2020-07-02 01:36:09,655 123145336020992 pic HelloTest_Coolpad5890-a17c171e_1593624969.5895932.png not exist
CRITICAL: run_test执行失败
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/testbase/testcase.py", line 703, in _thread_run
getattr(self._testcase, it)()
File "/Users/lqc/Working/QT4ADemoProj/demotest/hello.py", line 25, in run_test
app.login(acc, pwd)
File "/Users/lqc/Working/QT4ADemoProj/demolib/demoapp.py", line 36, in login
login_panel.login(acc, pwd)
File "/Users/lqc/Working/QT4ADemoProj/demolib/login.py", line 22, in login
self.wait_for_exist()
File "/usr/local/lib/python3.7/site-packages/qt4a/andrcontrols.py", line 170, in wait_for_exist
raise ControlNotFoundError('窗口:%s 未找到,当前窗口为:%s' % (self.class.Activity, current_activity))
tuia.exceptions.ControlNotFoundError: 窗口:com.qta.qt4a.demo.MainActivity 未找到,当前窗口为:paused=false
Process finished with exit code 0
执行demotest/hello.py报错如下:
2019-01-29 13:26:42,642 7832 thread Thread-2 exit
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\qt4a\androiddriver\util.py", line 525, in run
return threading.Thread.run(self)
File "C:\Python36\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Python36\lib\site-packages\qt4a\androiddriver\adb.py", line 486, in _logcat_thread_func
log = self._log_pipe.stdout.readline().decode('utf8').strip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 131: invalid continuation byte
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.