网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
09月12日漏签0天
appium吧 关注:447贴子:1,285
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 2回复贴,共1页
<<返回appium吧
>0< 加载中...

Appium使用python进行自动化测试问题,webdriver.Remote编码错误

  • 只看楼主
  • 收藏

  • 回复
  • superzzy8000
  • 学前班
    3
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
为了进行app测试,我进行了appium的学习,机器是win7-64位的,环境都已经搭好,下载代码如下:
#coding: utf-8
import os
from time import sleep
from appium import webdriver
# Returns abs path relative to this file and not cwd
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
)
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['browserName'] = ''
desired_caps['platformVersion'] = '4.4.2'
desired_caps['appPackage'] = 'com.njzx.lehuoli'
desired_caps['appActivity'] = '.ui.activity.base.MainActivity'
desired_caps['deviceName'] = 'emulator-5554'
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub/',desired_caps)
el = find_element_by_accessibility_id('com.njzx.lehuoli:id/button_login')
el.click()
time.sleep(5)
driver.quit()
运行以后报错:
Traceback (most recent call last):
File "E:\Workplace\app test\login_test.py", line 22, in <module>
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub/',desired_caps)
File "E:\Python27\lib\site-packages\appium\webdriver\webdriver.py", line 36, in __init__
super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "E:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
self.start_session(desired_capabilities, browser_profile)
File "E:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "E:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "E:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 401, in execute
return self._request(command_info[0], url, body=data)
File "E:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 481, in _request
body = data.decode('utf-8').replace('\x00', '').strip()
File "E:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 193: invalid start byte
哪位大大能帮我看看,好几天了,身为一个菜鸟,真的力不从心了,谢谢!


  • lyt5208090
  • 托儿所
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
请问解决没有。。。 我也出现这个啊啊


2026-09-12 16:22:40
广告
不感兴趣
开通SVIP免广告
  • 看寡妇的和尚
  • 学前班
    3
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
报错图 脚本呢


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 2回复贴,共1页
<<返回appium吧
分享到:
©2026 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示