Forum Discussion

AGubarev's avatar
AGubarev
SmartBear Alumni (Retired)
7 years ago

Video Recording of Test Execution is Easy

Hi folks!

My name is Alexander Gubarev, and I'm one of the QA engineers who are responsible for the TestComplete quality. Today, I want to share the VideoRecorder extension for TestComplete with you, which I hope will be helpful in your job.

This extension enables you to record videos for your automated tests running in SmartBear TestComplete or TestExecute. It records a video for your test runs helping you to check the test execution and to understand what happened in your system and in the tested application during the test run. All of us know, sometimes, it is really difficult to find the cause of issues that occur during nightly test runs. Videos can help you with this.

The extension adds the VideoRecorder script object for starting and stopping video recording from your script tests, and the Start and Stop Video Recording keyword-test operations for doing this from keyword tests.

Start using the VideoRecorder extension is easy - you simply need to install the extension on your computer and add call of it from TestComplete.

INSTALL VIDEORECORDER
1. Download the VLC installer from https://www.videolan.org/.
2. Install the VLC media player on your computer. The installation is straight-forward. Just follow the instructions of the installation wizard.
3. Download VideoRecorder.tcx (it's attached to this article).
4. Close TestComplete or TestExecute.
5. Double-click on the extension and install it in TestComplete or TestExecute.

USE VIDEORECORDER
1. In Keyword Tests
Add the Start Video Recording and Stop Video Recording operations at the beginning and at the end of your test. You can find these operations in the Logging operation category.
 

 

2. In Scripts
Use the VideoRecorder.Start() method to start recording and VideoRecorder.Stop() to stop it. Code example:
//JScript
function foo() {
   // Start recording with High quality
   VideoRecorder.Start("High");

   //Do some test actions
   //….

   //Stop recording 
   VideoRecorder.Stop();
}

Find the recorded video in your project folder – the link to it is located in the Test Log panel.

FULL DOCUMENTATION
https://github.com/SmartBear/testcomplete-videorecorder-extension/blob/master/README.md

WANT TO IMPROVE THE VIDEORECORDER?
We put this script extension on GitHub, so you can take part in its development. Feel free to make pull requests which can make this extension better:
https://github.com/SmartBear/testcomplete-videorecorder-extension

LATEST VIDEORECORDER VERSION
Also, to make sure you have the latest version of the script extension, you can download VideoRecorder.tcx from the GitHub repository:
https://github.com/SmartBear/testcomplete-videorecorder-extension/releases/latest
 
  • Hello, I have a quick question.

     

    In the "readme" it states that 

    • On systems with multiple display devices, it records the main display only.

    I currently use a laptop connected to two different monitors with the desktop being extended across both displays. When a test is recorded both screens are recorded side by side. Is this the correct functionality?

    • AGubarev's avatar
      AGubarev
      SmartBear Alumni (Retired)

      Yes, there are some changes in VCL player itself. The functionality was described for early versions of VLC player (which is also supported). 

      If you want to customize this behaviour I'd reccomend to use 

      --screen-left

      parameter.

       

      https://wiki.videolan.org/VLC_command-line_help

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi,

       

      The functionality of this script extension is to look for the VLC application and to start it providing some command-line parameters.

      The above means that you should check with VLC documentation whether the observed behavior is correct one.

      If the observed behavior can be controlled by some command-line parameter, you can check extension's source code (see above for description on how to do this) and add the required command-line parameter to meet your needs.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I have a question here, more general:

     

    The github repository, is it open for others to upload extensions and extension code?  Or is this strictly for SmartBear staff?  One of the things that has been tossed around as an idea is a central repository for anyone who wants to share their script extensions to put their stuff.  I have my own that I work with and have made available to others on bitbucket but it would be nice to have an "official" SmartBear shared extension repository.

    • prashantmohan's avatar
      prashantmohan
      Staff

      Hi Robert,

       

      Thank you for reaching out. 

      You are correct, we are exploring a shared repository that TestComplete users can post their work in to. We're open to suggestions about what the best forum would be.

       

      The idea of a shared GitHub repository could be a great start, but I'm open to other options as well. Once we decide on this, hopefully very soon, I'll send out a note so you can post your work there. 

       

      I appreciate you taking interest here Robert as we strive to make TestComplete as open as possible. Utilities from you and other members will be highly beneficial to the community. 

       

      Thanks,

      Prashant

  • Hello,

     

    My TC Version is: 12.50.4142.7 x86

    My VLC Version is: 3.0.1.0

    I have installed the extension and I have the Start/Stop Video Recording option available in my operations. VLC is installed and I was able to record my screen manually. (Starting it from VLC)

    When I run the recording in a test I get a warning:

    "Unable to start the recording. The VLC recorder is not installed. See Additional Info for details"

     

    And in the Additional Info is:


    "The video recorder uses the recording functionallity of the VLC framework.

    Download the recorder from the following website and install it:

    https://www.videolan.org/"

     

    What did I do wrong? Is there any way to sepcify the path to the VLC.exe?

    Thanks for your help in advance.


    Kai

    • AGubarev's avatar
      AGubarev
      SmartBear Alumni (Retired)

      cunderw , thanks a lot!

       

      Great commit and useful functionality.

       

      I've added it into Master and also re-attached new version of extension in this forum topic. 

  • AGubarev's avatar
    AGubarev
    SmartBear Alumni (Retired)

    I hope it's fixed for non-standard resolutions now.

    I re-attached the script extension and commit fix on GitHub.

  • mgroen2's avatar
    mgroen2
    Super Contributor

    AGubarev Created a new project in Jscript this morning. Got the same results (non-playing video file of 1kb). So in script it isn't working either.. :(

     

    Used TestComplete version:  12.42.3048.7 x86

    Used VLC version: 2.2.8 (32bit)

     

    Anyone got idea how to fix this? Is this even the right location for reporting bugs?

     

     

     

    • AGubarev's avatar
      AGubarev
      SmartBear Alumni (Retired)

      Hi, mgroen2

       

      It seems that the issue is related with resolution.

      Is the 1904x977 the real resolution on your monitor, or it somehow related to non-100% monitor?

       

      I prepared the new version of extension and re-attached it to this topic. Could you, please, try it?

      I tried to fix the error but not sure that it helps to non-standard resolutions.

      • mgroen2's avatar
        mgroen2
        Super Contributor

        AGubarev


        AGubarev wrote:

        Hi, mgroen2

         

        It seems that the issue is related with resolution.

        Is the 1904x977 the real resolution on your monitor, or it somehow related to non-100% monitor?

         

        I prepared the new version of extension and re-attached it to this topic. Could you, please, try it?

        I tried to fix the error but not sure that it helps to non-standard resolutions.


        Hi, yes it's not the real resolution, but it's related to non-100% monitor. I run TestComplete in a VM and when the VM is not maximed to full screen mode, the issue is occurring. Switching the VM to full screen mode resolves the issue.

         

    • AGubarev's avatar
      AGubarev
      SmartBear Alumni (Retired)

      Hi, mgroen2

       

      Hmm... it seems that something wrong in environment.

      Could you, please, launch you test, pause it after 2-3 seconds click on the icon of vlc player in taskbar and copy the text. Maybe some errors will be there.

      • mgroen2's avatar
        mgroen2
        Super Contributor

        AGubarev wrote:

        Hi, mgroen2

         

        Hmm... it seems that something wrong in environment.

        Could you, please, launch you test, pause it after 2-3 seconds click on the icon of vlc player in taskbar and copy the text. Maybe some errors will be there.


         

        Hi AGubarev,

         

        I did as you suggested, and now I got an error message.

        The error message is displayed below.

         

        can you help me with this?

  • mgroen2's avatar
    mgroen2
    Super Contributor

    I have installed Videolan Player, and the extension.

     

    When the test is run, there is made a file with the extension .mp4, but it's only 1kb and it doesn't play :(

     

    Attached is the project file (in rar format). 

     

    Anyone who can help me with this? Why it's not working...

    • mgroen2's avatar
      mgroen2
      Super Contributor

      extra info: Tested it with TestComplete 12.4 and VLC Player 2.2.8 32bit (64bit is not supported?)

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        If the VCL player is 32-bit, then you need to make sure that you run the 32-bit version of TC 12.4.  It is installed, by default, in C:\Program Files (x86)\SmartBear\TestComplete 12\Bin.  Try running that version of TestComplete with the video recorder and see if it works better.

  • mgroen2's avatar
    mgroen2
    Super Contributor

    Great! Sounds very promising, AGubarev.

     

    As AlexKaras already mentioned I have posted a feature request for this some time ago... good to read that it's implemented now..

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Just as a side note:  

       

      This was implemented as a ScriptExtension... which means, technically, it is not something that needed to be implemented by the SmartBear staff.  Anyone of us could have done it given the time and resource. :-) Again... this is what TestComplete brings to the table... it's open architecture with regards to plugins and extensions means that if you wish the tool to be able to perform some task, there is usually a way to do so without changing the core code of the tool. :)

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Alexander,

     

    Thank you a lot for the great post with the ready-to-use solution. Much appreciated!

     

    For others who may be interested, there were several other threads over here dedicated to video recording:

    https://community.smartbear.com/t5/TestComplete-Functional-Web/When-is-video-recording-being-supported-in-TestComplete/m-p/81528#M17920
    https://community.smartbear.com/t5/TestComplete-General-Discussions/Try-this-How-to-video-your-tests/td-p/139735
    https://community.smartbear.com/t5/TestComplete-General-Discussions/Automation-Execution-Report-Ready-to-Go/m-p/137035#M25544
    https://community.smartbear.com/t5/TestComplete-General-Discussions/Automation-Execution-Report/m-p/134112#M25013

     

    I did not look into extension's code yet, but the first link mentions Microsoft Expression Encoder that hopefully might be considered as an alternative option to be used within this script extension.