---
title: 'UFT GUItest - Run test via Command line'
disqus: hackmd
---
## UFT GUItest - Run test via Command line
* 利用命令提示字元執行腳本
* Micro Focus UFT One 15.0
* [Ref](https://admhelp.microfocus.com/uft/en/14.50-14.53/UFT_Help/Content/User_Guide/how2_run_batch.htm?Highlight=command%20line#mt-item-3)
## :rocket:Use UFTBatchRunner.exe
#### Step1:Open UFTBatchRunner.exe
路徑為 (UFT installation folder)/bin/UFTBatchRunner.exe
#### Step2:Add batches or tests
加入要執行的測試案例
1. batch file (.mtb):找到.mtb檔加入。

2. individual tests:加入測試專案

#### Step3:Run the test batch
按下  即開始執行。
#### Step4:執行結果

---
## :rocket:Use UFTBatchRunnerCMD.exe
#### Step1:Open cmd,輸入指令
```cmake
# the source switch followed by the test batch file (.mtb) or folder containing the test.
UFTBatchRunnerCMD.exe -source "C:\users\MySample.mtb"
UFTBatchRunnerCMD.exe -source "C:\users\APITest1"
```
#### Step2:若需輸入參數可以參考
```
UFTBatchRunnerCMD.exe -source "C:\users\GUITest1" -parameter "Parameter1=UFT;Parameter2=Test"
```
:::info
Passing test parameters is supported for running single tests only, and not for all tests in a folder.
:::
## Appendix and FAQ
:::info
**Find this document incomplete?** Leave a comment!
:::
###### tags: `UFT`,`GUItest`