【发布时间】:2017-06-12 15:49:29
【问题描述】:
使用 python 绑定 selenium3 webdriver 进行测试自动化,使用 castro 记录执行步骤,但在 Windows 7 x64 上失败。
是否有任何其他库或模块可用于记录目的
带有 castro 的代码
from castro import Castro
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
def my_video_record():
castroObject = Castro(filename="video/mytest.swf")
castroObject.start()
firefoxDriver = webdriver.Firefox(executable_path="firefox_geckodriver64bit/geckodriver")
firefoxDriver.get("https://www.python.org")
assert "Python" in firefoxDriver.title
sleep(1)
firefoxDriver.quit()
castroObject.stop()
if __name__ == '__main__':
my_video_record()
但它会在我的 Windows7 x64 上引发错误
Socket error: [Errno 10061] No connection could be made because the target machine actively refused it
Process Process-1:
Traceback (most recent call last):
File "D:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "D:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "D:\Python27\lib\site-packages\castro\lib\pyvnc2swf\vnc2swf.py", line 611, in main
merge=merge, debug=debug, reconnect=reconnect)
File "D:\Python27\lib\site-packages\castro\lib\pyvnc2swf\vnc2swf.py", line 429, in vnc2swf
client.loop()
File "D:\Python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 489, in loop
if not self.loop1(): break
File "D:\Python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 276, in loop1
self.request_update()
File "D:\Python27\lib\site-packages\castro\lib\pyvnc2swf\rfb.py", line 551, in request_update
self.send('\x03\x01' + pack('>HHHH', *self.clipping))
AttributeError: RFBNetworkClient instance has no attribute 'clipping'
【问题讨论】:
-
你在vnc服务器上使用vncauth吗?
标签: python selenium automated-tests