使用LDTP测试桌面云产品
由于最近工作需求,需要测试linux(client)上的桌面云产品,因此将之前的windows平台的测试脚本移植到linux平台。
在解决了一大堆依赖的问题后,重写了linux端的log和dmp的收集方法后,终于能走起一次了。
结果发生了ldtp访问的问题,而且问题还特别奇怪。
我的测试是重复连接远程云桌面500次,第一次连接都非常顺利,但是登出后第二次连接的时候,ldtp就罢工了,脚本会尝试重新连接远端的ldtp10次,第一次socket返回104,之后就什么都不返回了。
我开了新的python来检测该远程桌面的ldtp服务。
[root@localhost Utest]# python
Python 2.7.5 (default, Jun 20 2019, 20:27:34)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
import ldtp
/usr/lib/python2.7/site-packages/ldtp-3.5.0-py2.7.egg/ldtpd/core.py:29: PyGIWarning: Wnck was imported without specifying a version first. Use gi.require_version(‘Wnck’, ‘3.0’) before import to ensure that the right version gets loaded.
from gi.repository import Wnck as wnck
#设置ldtp host为 10.117.27.110:8001端口ldtp.setHost(“10.117.27.110:8001”)
#获取桌面元素成功ldtp.getwindowlist()
[‘paneTaskbar’, ‘frmWindows PowerShell ISE Main Window’, ‘frmC:\Windows\system32\cmd.exe’, ‘paneProgram Manager’]
#登出桌面,此时ldtp的connection已经中断了
#重新login桌面,启动新的ldtp service
#继续使用之前的ldtp object尝试获取元素,失败,报错104ldtp.getwindowlist()
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/site-packages/ldtp-3.5.0-py2.7.egg/ldtp/client.py”, line 75, in call
return self.__sen