How to capture a screenshot using VBScript in TestComplete?

21,803

To capture a desktop screenshot, use the Sys.Desktop.Picture method. To save the resulting image to a file, use its SaveToFile method:

Sys.Desktop.Picture.SaveToFile "E:\screenshot.png"

Alternatively, you can turn on the Test Visualizer to automatically capture screenshots for your test actions.

Share:
21,803
Ramakrishna
Author by

Ramakrishna

Iphone Programmer

Updated on August 20, 2020

Comments

  • Ramakrishna
    Ramakrishna almost 4 years

    I'm using TestComplete. I need to capture a screenshot and place it in a particular folder. How to do this using VBScript?

  • Helen
    Helen over 11 years
    @YallaRamakrishna: If it worked for you, please mark it as solution answer so other people will know.
  • Ramakrishna
    Ramakrishna over 11 years
    Actually i am new user for stack overflow.I really don't know how it will be marked please tell me the procedure.
  • Helen
    Helen over 11 years
    @YallaRamakrishna: To mark an answer ac accepted, click on the check mark to the left of the answer: cdn.sstatic.net/img/faq/faq-accept-answer.png
  • nonozor
    nonozor over 5 years
    What is "Sys" ? This doesn't worked for me, vbs seems to doesn't recognize it.