2

testrunnerJenkins ビルドを介して CLI でスクリプトを実行しています。実行ごとに結果を新しいフォルダーに保存したい。どうすればいいのですか?

testrunner.bat -r -j -J "-fC:\Users\xxxxxx\Desktop\Reports\xxx\xxx" "-RProject Report" "-EDefault environment" -I "C:\TCOE\Automated_Smoke_and_Regression_SoapUI_Tests\xxx\xxx_PRODUCTION- soapui-project.xml"

現在、スクリプトは上記の貼り付けたもののように見えます。レポートのルートの場所を明示的に宣言する場所。

各実行でレポートが新しい場所に確実に保存されるようにするにはどうすればよいですか?

Jenkins と SOAPUI のどちらを使用しますか? 最善のアプローチは何ですか?

ありがとうサンディップ

4

1 に答える 1

2

date timeこれは、以前の結果を上書きせずに結果を取得するために使用する動的ディレクトリを設定できる Windows バッチ ファイルです。

もちろん、Jeninks からバッチ ファイルを呼び出すこともできます。

以下のスクリプトをファイルにコピーし、wrapper_testrunner.cmdこのファイルを testrunner.bat のある場所に配置します。それはsoapuiのtestrunner.batファイルを呼び出すため、つまり、このバッチファイルをSOAPUI_HOME/binディレクトリの下に置きます。

@echo off

REM Provide the base directory where the results needs to be saved
REM A new dynamic directory is created using date time under this directory
set RESULTS_BASE_DIR=C:\Temp\TEST_Results

REM Set the soapui project to run 
set PROJECT=C:\Temp\Project\hellow-world-soapui-project.xml

REM Set the environment name
set ENVIRONMENT_NAME="Default environment"

REM set the dynamic directory name using date time
set mdate=%date:~10%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%


REM create dynamic directory for results
mkdir %RESULTS_BASE_DIR%\%mdate%

REM run the project using testrunner
call testrunner.bat -f %RESULTS_BASE_DIR%\%mdate% -E %ENVIRONMENT_NAME% -raj %PROJECT%

変数の値を変更する必要がある場合は、自由に変更してください。プレースホルダーのみを配置しました。

とは言っても、testrunner.batファイルに渡す必要がある追加のオプションも追加します。

これが役に立てば幸いです。

于 2016-11-10T14:35:27.950 に答える