You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无Outlook/共享路径的UFT/ALM虚拟机测试后自动发ALM报告问询

Feasible Solutions to Automate ALM Report Delivery Post VM Test Execution

Absolutely, this is totally feasible! Let’s break down three practical approaches tailored to your constraints:

Approach 1: Use ALM REST API + Direct SMTP from VM (No Outlook Required)

Since your VM has ALM access, you can leverage ALM’s REST API to fetch the test report and send it via SMTP directly—no Outlook needed. Here’s how:

  • Step 1: Capture test completion in UFT: Add a post-execution script in your UFT test set that triggers once all tests finish.
  • Step 2: Fetch the report via ALM API: Use VBScript (native to UFT) or PowerShell to call ALM’s REST endpoints to generate and export the test run report (PDF/HTML). For example, you can use endpoints to pull test run details and compile a custom report, or retrieve the auto-generated ALM report attachment.
  • Step 3: Send via SMTP: Use a script to send the exported report as an attachment using an SMTP server (your company’s internal SMTP or a public service like Gmail—just note you’ll need app-specific passwords for public providers).
    • Example VBScript snippet for SMTP:
      Set objEmail = CreateObject("CDO.Message")
      objEmail.From = "your-test-alerts@company.com"
      objEmail.To = "stakeholder@company.com"
      objEmail.Subject = "ALM Test Report: Test Set [XYZ] Completed"
      objEmail.TextBody = "Attached is the full execution report for your review."
      objEmail.AddAttachment "C:\VM_Test_Reports\Latest_Run.pdf"
      
      ' Configure SMTP settings
      objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
      objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.company.com"
      objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
      objEmail.Configuration.Fields.Update
      
      objEmail.Send
      Set objEmail = Nothing
      

Approach 2: VM Triggers Local Machine to Fetch & Send (Uses Local Outlook)

If you need to use your local Outlook (e.g., company policy mandates it), you can set up a cross-machine workflow:

  • Step 1: Mark test completion in ALM: On the VM, after test execution, update a custom field in the ALM test set (like Execution_Completed = True) via UFT’s ALM integration or API calls.
  • Step 2: Local polling task: On your local machine, create a scheduled PowerShell/VBA script that periodically checks ALM for test sets marked as completed.
  • Step 3: Fetch and send via Outlook: When a completed test set is detected, use ALM’s API to pull the report, then use Outlook’s object model to send the email with the attachment.
    • Example PowerShell snippet for Outlook:
      $outlook = New-Object -ComObject Outlook.Application
      $mail = $outlook.CreateItem(0)
      $mail.Subject = "ALM Test Report: Test Set [XYZ] Execution Done"
      $mail.To = "stakeholder@company.com"
      $mail.Body = "The test set finished running. See attached report for details."
      $mail.Attachments.Add("C:\Local_Downloads\ALM_Test_Report.pdf")
      $mail.Send()
      [System.Runtime.Interopservices.Marshal]::ReleaseComObject($outlook) | Out-Null
      

Approach 3: Use ALM’s Built-in Email Notifications (Simplest Option)

Check if your ALM instance is configured for email alerts—this is the easiest method if available:

  • Ask your ALM admin to verify the ALM server is set up with an SMTP server.
  • Configure a notification rule in ALM: Go to Project Customization > Notifications and create a rule that triggers when a test set’s execution status changes to "Completed".
  • You can set the alert to include a direct link to the ALM report, or even attach the report if ALM is configured to generate it automatically.

Key Considerations

  • Secure Credentials: Never hardcode ALM/SMTP credentials in scripts. Use environment variables, secure vaults, or ALM’s session tokens instead.
  • Error Handling: Add try-catch blocks in your scripts to handle API timeouts, report generation failures, or email sending errors (log issues to a local file for debugging).
  • Network Access: Ensure the VM has access to the ALM server and SMTP server; for Approach 2, confirm your local machine can reach the ALM server.

内容的提问来源于stack exchange,提问作者Pranav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:14:29