SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    a way to check whether the test was ran by automation

    Is there a way to check whether the script was ran by automation?
    Sometimes I run the test using the QTP -> run (when I'm debugging, for example), and other times using the automation model and command line (nightly runs).

    I'm looking for a way to know within the test which of these two modes is currently running.
    (for example, I would like to send emails with the results only in the second kind of run).

    Does anyone know how to do that?

  2. #2
    Senior Member
    Join Date
    Feb 2005
    Location
    Northern Ireland
    Posts
    529
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: a way to check whether the test was ran by automation

    I'll assume that you are using vbs to run the automation model from Command Line, if so, just add a snazzy bit of CDONTS code to send email via SMTP in your VBscript.
    I'm not a complete idiot - some parts are missing.

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    210
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: a way to check whether the test was ran by automation

    Or check whether QTAutomationAgent.exe is running...
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=imper sonate}!\\.\root\cimv2&quot
    Set colProcesses = objWMIService.ExecQuery( &quot;Select * from Win32_Process Where Name = 'QTAutomationAge'&quot
    If colProcesses.Count &gt; 0 Then
    MsgBox &quot;Running by Automation&quot;
    End If</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    -Dima

  4. #4
    Senior Member
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: a way to check whether the test was ran by automation

    Thanks guys!
    I'll check both your suggestions.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 7.14%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:12 PM.

Copyright BetaSoft Inc.