Results 1 to 6 of 6
  1. #1

    sending SMS/Email through Winrunner script

    Hi All,
    Is it possible to send an SMS or Email through WR Script when some error is observed by the script while executing?

  2. #2
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    St. Louis - Year 2025

    Re: sending SMS/Email through Winrunner script


  3. #3

    Re: sending SMS/Email through Winrunner script

    Yep - I do it all the time at the end of the nghtly runs to inform eeryone of the status, wether it is pass or fail
    Insanity: doing the same thing over and over again and expecting different results

  4. #4
    Junior Member
    Join Date
    Jun 2005

    Re: sending SMS/Email through Winrunner script

    Use the CSOLIBX from Wilson Mar to SMTP mail your messages. Don't forget to use Paypal when the library and function was helpfull.

  5. #5

    Re: sending SMS/Email through Winrunner script

    Why not just use the CDO.Message object that is already there for you (it is free ;-) )

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">public function file_temp_path(out ps_temppath)
    auto n_rc; #as long

    # Get the path of the windows temp directory
    n_rc = GetTempPathA(255,ps_temppath);

    # return the length of the temppath string

    public function file_delete(in lpFileName)
    # initialize all needed variables
    auto n_rc; #as return code

    # delete the passed filename from the directory structure - returning status
    n_rc = DeleteFileA(lpFileName);

    # translate the API return code to match WinRunner
    (n_rc == 1)? n_rc = E_OK:n_rc = E_GENERAL_ERROR;

    # return the status of the function
    return (n_rc);

    public function email(in to, in cc, in bcc, in from,
    in subject, in body, in attach)
    auto s_script,s_tagfile,s_temppath; #as string
    auto n_rc; #as long

    # Set the path for the script to something that is always going to be availabe
    # and unique
    s_script = s_temppath &amp; &quot;email-&quot; &amp; get_time() &amp; &quot;.vbs&quot;;

    # set the tagfile info
    s_tagfile = &quot;done-&quot; &amp; get_time();

    # open the file for writing and create the needed info to send an e-mail through
    # VBScript functionality
    n_rc = file_open(s_script,FO_MODE_WRITE);
    file_printf(s_script,&quot;Set Msg = CreateObject(\&quot;CDO.Message\&quot\r\n&quot;
    file_printf(s_script,&quot;With Msg\r\n&quot;
    file_printf(s_script,&quot;.From = \&quot;%s\&quot;\r\n&quot;,from);
    file_printf(s_script,&quot;.To = \&quot;%s\&quot;\r\n&quot;,to);
    file_printf(s_script,&quot;.CC = \&quot;%s\&quot;\r\n&quot;,cc);
    file_printf(s_script,&quot;.BCC = \&quot;%s\&quot;\r\n&quot;,bcc);
    file_printf(s_script,&quot;.Subject = \&quot;%s\&quot;\r\n&quot;,subject);
    file_printf(s_script,&quot;.TextBody = \&quot;%s\&quot;\r\n&quot;,body);
    if (attach != &quot;&quot {
    file_printf(s_script,&quot;.AddAttachment (\&quot;%s\&quot\r\n&quot;,attach); }
    file_printf(s_script,&quot;End With\r\n&quot;
    file_printf(s_script,&quot;dim filesys, filetxt, getname, path\r\n&quot;
    file_printf(s_script,&quot;Set oFilesys = CreateObject(\&quot;Scripting.FileSystemObject\&qu ot\r\n&quot;
    file_printf(s_script,&quot;Set filetxt = oFilesys.CreateTextFile(\&quot;.\%s\&quot;, True)\r\n&quot;,s_tagfile);
    file_printf(s_script,&quot;path = oFilesys.GetAbsolutePathName(\&quot;.\%s\&quot\r\n&quot;,s_tagfile);
    file_printf(s_script,&quot;getname = oFilesys.GetFileName(path)\r\n&quot;
    file_printf(s_script,&quot;filetxt.WriteLine(\&quo t;Done.\&quot\r\n&quot;
    n_rc = invoke_application(s_script,&quot;&quot;,s_temppat h,SW_HIDE);
    if(n_rc == E_OK)
    while(file_exists(s_temppath &amp; s_tagfile) != E_OK)
    file_delete(s_temppath &amp; s_tagfile);
    file_delete(s_script); }
    }</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

    [ 06-24-2005, 06:21 AM: Message edited by: Tony Davis ]
    Insanity: doing the same thing over and over again and expecting different results

  6. #6

    Re: sending SMS/Email through Winrunner script

    r u from nandyal ,srinivasanagar



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:59 PM.

Copyright BetaSoft Inc.