Comments (7)
@kagamimoe 你好,poco可以先回退一个版本试试pip install -U pocoui=1.0.56
from poco.
可以尝试在启动游戏之后初始化poco:
class test002(unittest.TestCase):
def setUp(self):
print "开始启动游戏"
normal_start()
self.poco = StdPoco(15004, device)
from poco.
@Meteorix poco回退到 1.0.56版本后 报另一个错误
Traceback (most recent call last):
File "D:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.6\helpers\pycharm\utrunner.py", line 116, in <module>
modules = [loadSource(a[0])]
File "D:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.6\helpers\pycharm\utrunner.py", line 40, in loadSource
module = imp.load_source(moduleName, fileName)
File "C:\sgame\scripts\test002.py", line 12, in <module>
from lib.common import normal_start,normal_exit,pic_dir_setting,return_panel,pic_dir
File "C:\sgame\lib\common.py", line 16, in <module>
poco = StdPoco(15004, device)
File "C:\Python27\lib\site-packages\poco\drivers\std\__init__.py", line 93, in __init__
agent = StdPocoAgent((ip, port))
File "C:\Python27\lib\site-packages\poco\drivers\std\__init__.py", line 28, in __init__
self.c.connect()
File "C:\Python27\lib\site-packages\poco\utils\simplerpc\rpcclient.py", line 23, in connect
self._wait_connected(timeout)
File "C:\Python27\lib\site-packages\poco\utils\simplerpc\rpcclient.py", line 37, in _wait_connected
raise RpcConnectionError("Rpc Connection Closed")
poco.utils.simplerpc.simplerpc.RpcConnectionError: Rpc Connection Closed
[10:48:19][DEBUG]<airtest.core.android.adb> C:\Python27\lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s ce12160cc43a001f0c forward --remove tcp:19378
from poco.
启动游戏之后初始化poco的话, 那在其他方法里怎么调用poco呢
提示这个错误:
Error
Traceback (most recent call last):
File "C:\sgame\scripts\test002.py", line 31, in test_change_name
if poco("imgHead").exists:
NameError: global name 'poco' is not defined
from poco.
这样你就可以 self.poco("imgHead").exists:
from poco.
或者你可以把poco设置为全局变量
poco = None
class test002(unittest.TestCase):
def setUp(self):
print "开始启动游戏"
normal_start()
global poco
poco = StdPoco(15004, device)
from poco.
声明为全局变量后可以跑了。谢谢大佬
from poco.
Related Issues (20)
- [pocoservice.apk] instrumentation test server process is no longer alive
- 当text存在中文的?时使用poco(text="text?")定位会失败
- 能否新增一个获取某个元素在其兄弟节点中的索引值,或者可以直接获取该元素的上一个节点和下一个节点 HOT 1
- MI 9 设备,执行一会usb自动断开,已经开启了自启动。
- 源码parent方法注释有误 HOT 1
- > 集成完poco-sdk后,能获取到UI树,但是我点击按钮报select invalid payload ![image](https://user-images.githubusercontent.com/65537469/82197632-ccfe0900-992d-11ea-88b9-5b1c4e483f19.png)
- 还会做cocos creator 3.x兼容吗? HOT 1
- 循环点击一个元素,当元素消失时报错TypeError: object of type 'NoneType' has no len()
- Demo apk repo
- pocoservice.apk在使用过程中出现重启
- shell am start -n com.netease.open.pocoservice/.TestActivity
- poco==0.99.1里的pyyaml版本冲突
- Support for other device clouds like BrowserStack
- HarmonyOS执行多次代码片段崩溃,根据Airtest官网进行手机权限设置仍然出现此问题 HOT 2
- HarmonyOS执行多次代码片段崩溃,根据Airtest官网进行手机权限设置仍然出现此问题
- ios 不支持缩放吗?
- 升级到1.1.16后带wait_for_appearance参数的Poco命令变慢
- Currently only supports port forwarding for locally connected iOS devices HOT 1
- 多匹配元素时,为什么指定顺序的操作元素有时是对的,但是不指定顺序,默认并非第一个元素?
- airtest ide执行脚本,poco().clikc()在设备上成功点击,但是报告展示的步骤是截图,而且从内容来看,貌似是说定位失败了,但是控制台也没有打印失败内容 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poco.