SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Feb 2002
    Location
    Detroit , USA
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to send test log details via email through script?

    I have a requirement to create a script to cover few test cases.The script has to send test log details to certain number of people via email after each execution without manual intervention.
    Can any of you suggest an efficient way to meet this requirement?
    Thanks in advance!

    Sunil

  2. #2
    Junior Member
    Join Date
    May 2004
    Location
    hyderabad
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to send test log details via email through script?

    Hi Sunil,

    This is the sample script for giving you an idea how to implement above task if you have outlook installed on your machine.This script uses outlook object model to send mail.Outlook displays
    a security alert if some external program send a mail using it. So if we are placing the automation
    code in robot then robot will be unable to click
    yes button on the security warning window.

    so i am placing the code for sending mail in a vbs
    file and run this file using wscript.

    place the following code in Notepad and save the file as "C:\Test1.vbs" file:

    Dim oOutlookApp
    Dim oOutlookMessage

    Set oOutlookApp = CreateObject("Outlook.Application")
    Set oOutlookMessage = oOutlookApp.CreateItem(0)
    With oOutlookMessage
    .To = WScript.Arguments(0)
    .Subject = WScript.Arguments(1)
    .Body = WScript.Arguments(2)
    .Attachments.Add WScript.Arguments(3)
    .Send
    End With

    Place the following code in robo:

    Sub Main
    Dim intResult as Integer
    Dim strTo as String
    Dim strSubject as String
    Dim strBody as String
    Dim strAttachmentPath as String
    Dim strOutLookScriptPath as string

    strTo = "tester@rediff.net"
    strSubject = "Test"
    strBody = "Hi"
    strAttachmentPath = "C:\test1.txt"
    strOutLookScriptPath = "C:\Test.vbs"

    shell("wscript " & strOutLookScriptPath & " " & strTo & " " & strSubject & " " & strBody & " " & strAttachmentPath)

    'Click yes when security warning is displayed.
    intResult = WindowVP (Exists,"Caption=Microsoft Outlook", "VP=Window Existence;Wait=1,20")

    If intResult Then
    Window SetContext, "Caption=Microsoft Outlook", ""
    PushButton Click, "Text=Yes"
    End If

    End Sub

    The other alternative is to use third party components for sending email.you may find some of them in net for free.

  3. #3
    Junior Member
    Join Date
    Jul 2003
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to send test log details via email through script?

    Hi,
    In the code -- strAttachmentPath = "C:\test1.txt", I think I need to attach test log here, so can anyone tell me where I could find the test log?

    Thanks.

  4. #4
    Senior Member
    Join Date
    Oct 2001
    Location
    Presov, Slovakia
    Posts
    201
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to send test log details via email through script?

    Hi Sunil,
    Test logs are stored in "<project DIR>\TestDatastore\TMS_Builds\..", but I'm not sure if it help you.
    If you want to give somebody a fish, you'll do better if you teach him how to catch it.

    Marek Fric
    ICQ# 114486928

 

 

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 9.68%
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 06:25 AM.

Copyright BetaSoft Inc.