• Home
  • Company
    • About
    • Customers
    • Testimonials
    • Contact Us
    • My Account
  • Products
  • Downloads
  • Tutorials
  • Professional Services
  • Home
  • Company
    • About
    • Customers
    • Testimonials
    • Contact Us
    • My Account
  • Products
  • Downloads
  • Tutorials
  • Professional Services
Free Edition Compatible
Run Your Python Test from Coronys
Objectives
In this tutorial you'll learn HOW TO:
► Run your Python test from Coronys ETS
► Catch PASS/FAIL resulting verdict by event-drive technique
► Extract piece of data from message flow in run-time
All Tutorials
How to ...
Add a New Test Step
Right click on any sibling leaf to add a new test step:
Give a name to the new test step:
"ESL Script" button defines the new item as a script.
Choose meaningful name to the test step.
Select "Selection Time Parameters" checkbox if required.
Click "Add" button to append the test step to the pre-view list on the right.
Define Test Parameters
Define selection time parameters:
Click to add a new selection time parameter
Variable Name will be recognizable and its value available in your script.
Define default value
This explanation will appear each time the test step is dragged to the flow.
"File" type will open the Windows file explorer as this parameter is selected by user.
Click OK to apply
Write a Script
Copy the script below and paste it to the template created by the ESL Editor.
Press F1 in ESL Editor for Help and API index.
The script invokes your Python in a hidden CMD Shell and completes upon "C:\" prompted.
  Declare  Status
  DeclareOnce  epAppFile = `FILE`   ; Application file name with full path    
  DeclareOnce  epTimeout = 5000   ; "Wait for completion" timeout   
  ; Start CMD process and open connection to it
  Declare  PortID
  RC_CommandPortSet  PortID ,   'cmd.exe'
  ; Run file ('^J^M' are for '\r\n')
  RC_SendAndWait  Status ,  PortID ,  epAppFile  $   '^J^M' ,   'C:\' ,  epTimeout
  ; Check if timeout expired
  If  Status  !=   0   Then   TMMessage   GT_ErrorID ,   `Out of sync` ; Timeout expired
  ; Close Connection
  RC_Close  PortID
  End
Create Test Flow
Drag your new test step to the Flow Editor:
If you defined "Selection Time Parameters", the "User Parameters" window will pop up:
Click on Value field to open FIle Explorer to choose your application to run.
Define timeout longer than expected execution time.
Ckick OK to apply.
Run Your Test
Click "Run" button to run your test.
  • Home
  • Products
  • Downloads
  • Tutorials
  • Contact Us
  • Terms of Use
  • Privacy Policy

Copyright © 2002-2017 Coronys Ltd. All Rights Reserved.
 
Back to top