how to record selenium webdriver test executions in python on window x64

后端 未结 3 1396
悲&欢浪女
悲&欢浪女 2021-01-25 05:23

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 mo

相关标签:
3条回答
  • 2021-01-25 05:59

    The reason is you have not enabled vnc loop back connection.

    0 讨论(0)
  • 2021-01-25 06:06

    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.

    The code looks like this :

    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
    
    0 讨论(0)
  • 2021-01-25 06:09

    Selenium provides us with the feature to run the automation code/suite and record the output as a video and save it on your system. This video can then be shared with anyone who can see what the automation is doing. First of all, to enable video recording, we need to download some important jars. They are freely available to download from Google. Below are the jars to be downloaded. These are the latest version available, any other version can also be downloaded:

    ATUReporter_Selenium_testNG_5.1.1 ATUTestRecorder_2.1

    You can find the complete code in below link: https://mytechdevice.com/how-to-record-video-of-automation-output-in-selenium/

    0 讨论(0)
提交回复
热议问题