Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行webview demo报错 #3

Open
3638836363 opened this issue Feb 26, 2019 · 0 comments
Open

运行webview demo报错 #3

3638836363 opened this issue Feb 26, 2019 · 0 comments

Comments

@3638836363
Copy link

log:

测试用例:WebViewTest 所有者:Administrator 优先级:High 超时:5分钟


步骤1: 1、登录Android demo,进入网页视图
RESOURCE: acquire resource (res_type:android, res_group:None, condition:{}) successfully
172.16.0.227:5555(google Nexus 5 armeabi-v7a Android 6.0.1)
ENVIRONMENT: 申请 Android 设备成功:google Nexus 5(172.16.0.227:5555)
Hello
GetControl
GetControlVisibility
EnableSoftInput
SetControlText
GetControl
GetControlVisibility
EnableSoftInput
SetControlText
GetControl
GetControlVisibility
GetObjectFieldValue
GetControlRect
GetControlRect
Click
INFO: 登录完成
GetControl
GetControlVisibility
GetObjectFieldValue
GetControlRect
GetControlRect
Click

步骤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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant