<legend id='s5xYO'><style id='s5xYO'><dir id='s5xYO'><q id='s5xYO'></q></dir></style></legend>

    <bdo id='s5xYO'></bdo><ul id='s5xYO'></ul>

        <tfoot id='s5xYO'></tfoot>
        <i id='s5xYO'><tr id='s5xYO'><dt id='s5xYO'><q id='s5xYO'><span id='s5xYO'><b id='s5xYO'><form id='s5xYO'><ins id='s5xYO'></ins><ul id='s5xYO'></ul><sub id='s5xYO'></sub></form><legend id='s5xYO'></legend><bdo id='s5xYO'><pre id='s5xYO'><center id='s5xYO'></center></pre></bdo></b><th id='s5xYO'></th></span></q></dt></tr></i><div id='s5xYO'><tfoot id='s5xYO'></tfoot><dl id='s5xYO'><fieldset id='s5xYO'></fieldset></dl></div>
      1. <small id='s5xYO'></small><noframes id='s5xYO'>

      2. 如何在window x64上的python中记录selenium webdriver测试

        时间:2023-09-12

          <small id='uMM6h'></small><noframes id='uMM6h'>

          <legend id='uMM6h'><style id='uMM6h'><dir id='uMM6h'><q id='uMM6h'></q></dir></style></legend>

          <i id='uMM6h'><tr id='uMM6h'><dt id='uMM6h'><q id='uMM6h'><span id='uMM6h'><b id='uMM6h'><form id='uMM6h'><ins id='uMM6h'></ins><ul id='uMM6h'></ul><sub id='uMM6h'></sub></form><legend id='uMM6h'></legend><bdo id='uMM6h'><pre id='uMM6h'><center id='uMM6h'></center></pre></bdo></b><th id='uMM6h'></th></span></q></dt></tr></i><div id='uMM6h'><tfoot id='uMM6h'></tfoot><dl id='uMM6h'><fieldset id='uMM6h'></fieldset></dl></div>
        • <tfoot id='uMM6h'></tfoot>
          • <bdo id='uMM6h'></bdo><ul id='uMM6h'></ul>
                  <tbody id='uMM6h'></tbody>
                  本文介绍了如何在window x64上的python中记录selenium webdriver测试执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  使用 python 绑定 selenium3 webdriver 进行测试自动化,使用 castro 记录执行步骤,但在 Windows 7 x64 上失败.

                  Using python binding selenium3 webdriver for test automation, to record execution steps using castro but it is failing on Windows 7 x64.

                  是否有任何其他库或模块可用于记录目的

                  Is there any other library or module which can be used for recording purpose

                  带有 castro 的代码

                  Code with 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 上引发错误

                  But it throws error on my 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:Python27libmultiprocessingprocess.py", line 258, in _bootstrap
                      self.run()
                    File "D:Python27libmultiprocessingprocess.py", line 114, in run
                      self._target(*self._args, **self._kwargs)
                    File "D:Python27libsite-packagescastrolibpyvnc2swfvnc2swf.py", line 611, in main
                      merge=merge, debug=debug, reconnect=reconnect)
                    File "D:Python27libsite-packagescastrolibpyvnc2swfvnc2swf.py", line 429, in vnc2swf
                      client.loop()
                    File "D:Python27libsite-packagescastrolibpyvnc2swf
                  fb.py", line 489, in loop
                      if not self.loop1(): break
                    File "D:Python27libsite-packagescastrolibpyvnc2swf
                  fb.py", line 276, in loop1
                      self.request_update()
                    File "D:Python27libsite-packagescastrolibpyvnc2swf
                  fb.py", line 551, in request_update
                      self.send('x03x01' + pack('>HHHH', *self.clipping))
                  AttributeError: RFBNetworkClient instance has no attribute 'clipping'
                  

                  推荐答案

                  我不推荐使用 castro.它真的过时了,我已经尝试在自己的测试中使用它并且确实让它运行但它太不稳定了.

                  I do not recommend using castro. It's really outdated, I've tried using it in my own tests and did get it running but it was too unstable.

                  我目前正在使用 (屏幕录制软件),它就像一个魅力.它允许您设置帧率、分辨率、比特率以及选择不同的视频编解码器.

                  I'm currently using ffmpeg together with screen-capture-recorder (screen recording software) and it works like a charm. It allows you to set the framerate, resolution, bitrate as well as chose different video codec.

                  代码如下所示:

                  from subprocess import Popen
                  from subprocess import call
                  
                  cmd = 'ffmpeg -y -rtbufsize 2000M -f dshow  -i video="screen-capture-recorder" -s 1920x1080 -b:v 512k -r 20 -vcodec libx264 test.avi'
                  
                  def terminate(process):
                      if process.poll() is None:
                          call('taskkill /F /T /PID ' + str(process.pid))
                  
                  videoRecording = Popen(cmd) # start recording
                  
                  terminate(videoRecording)   # terminates recording
                  

                  这篇关于如何在window x64上的python中记录selenium webdriver测试执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 Robot Framework 中将数据附加到 csv 文件? 下一篇:Python unittest 将参数传递给父测试类

                  相关文章

                  最新文章

                    <i id='6FGvP'><tr id='6FGvP'><dt id='6FGvP'><q id='6FGvP'><span id='6FGvP'><b id='6FGvP'><form id='6FGvP'><ins id='6FGvP'></ins><ul id='6FGvP'></ul><sub id='6FGvP'></sub></form><legend id='6FGvP'></legend><bdo id='6FGvP'><pre id='6FGvP'><center id='6FGvP'></center></pre></bdo></b><th id='6FGvP'></th></span></q></dt></tr></i><div id='6FGvP'><tfoot id='6FGvP'></tfoot><dl id='6FGvP'><fieldset id='6FGvP'></fieldset></dl></div>
                    <tfoot id='6FGvP'></tfoot>

                  1. <legend id='6FGvP'><style id='6FGvP'><dir id='6FGvP'><q id='6FGvP'></q></dir></style></legend>
                    • <bdo id='6FGvP'></bdo><ul id='6FGvP'></ul>

                    <small id='6FGvP'></small><noframes id='6FGvP'>