简体   繁体   English

AttributeError:无法在 appium-python 中设置属性

[英]AttributeError: can't set attribute in appium-python

import time
import unittest
from appium.webdriver.webdriver import WebDriver as AppiumDriver
from appium import webdriver
desired_caps = dict(
platformName='Android',
deviceName='Android Emulator',
app=('C:/Users/Asus/Desktop/h.a/asan.apk')
)
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

i recieved this error: appium-python我收到这个错误:appium-python

i got this message:我收到这条消息:

how can i fix it?我该如何解决?

am using appium and android studio emulator to simulate and automation test of android application.我正在使用 appium 和 android studio 模拟器来模拟和自动化测试 android 应用程序。

Traceback (most recent call last):
  File "C:\Users\Asus\workspace\top web\complete.py", line 19, in <module>
    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\appium\webdriver\webdriver.py", line 151, in __init__
    super().__init__(
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\appium\webdriver\webdriver.py", line 229, in start_session
    self.capabilities = response.get('value')
AttributeError: can't set attribute

I had this same issue and it got fixed by re-installing appium with python instead of npm.我遇到了同样的问题,通过使用 python 而不是 npm 重新安装 appium 解决了这个问题。

I installed appium from source https://github.com/appium/python-client我从源代码https://github.com/appium/python-client安装了 appium

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM