QTP を Hudson と統合して、Hudson にデプロイされたコードに対してテスト スイートを自動的に呼び出す必要があります。ビルド プロセスは Maven に基づいています。
これを達成するためのプラグインなどはありますか?Hudson の Groovy プラグインについて聞きました。Groovy スクリプトで実行できますか?
QTP を Hudson と統合して、Hudson にデプロイされたコードに対してテスト スイートを自動的に呼び出す必要があります。ビルド プロセスは Maven に基づいています。
これを達成するためのプラグインなどはありますか?Hudson の Groovy プラグインについて聞きました。Groovy スクリプトで実行できますか?
Hudson はテストを実行しません。出力を取得して適切なレポートを生成します。Maven にテストを実行させる方法を確認してから、Hudson に出力を取得してレポートを生成させる必要があります。
We have implemented this integration in 3 ways, using VBScript,JScript and RunTestSet utility. In POM, we need to specify like this.
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>test</phase>
<configuration>
<tasks>
<property name="vbs.script" value='qtp.vbs'/>
<exec executable="WScript.exe" spawn="true" resolveExecutable="true">
<arg line="${vbs.script}"/>
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Using RunTestSet,
<exec executable="location of RunTestSet.exe" output="outputFolder">
<arg line="/s:qc url"/>
<arg line="/n:Domain"/>
<arg line="/d:Project"/>
<arg line="/u:username"/>
<arg line="/p:password"/>
<arg line="/f:TestSetFolder"/>
<arg line="/t:TestSet"/>
<arg line="/l"/>
</exec>
Regards,
Ramya.
Michael が言うように、これは Hudson の問題ではなく Maven 統合の問題です。QTP 用の Maven プラグインについては知りませんが、exec-maven-pluginを使用して任意の実行可能ファイルを呼び出し、その実行可能ファイルに引数を提供できます。QTP は、かなり簡単にスクリプトにラップできる「自動化」API を提供します。スムーズな統合にはなりませんが、目的には役立つかもしれません。
使用できる構成の例を次に示します。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>[qtp executable]</executable>
<workingDirectory>/target</workingDirectory>
<arguments>
<argument>[an argument to configure QTP]</argument>
<argument>[another argument to configure QTP]</argument>
</arguments>
</configuration>
</plugin>
Ant からの QTP の呼び出しに関する以前の質問への回答は、Automation 統合を作成するための良い出発点です。
アップデート:
これがあなたのために働くかもしれないアプローチです。実行したいテストの名前を渡して、QTPサーバーを直接呼び出すことができるようです。そのため、 antrun プラグインを使用して URL を呼び出し、出力をターゲット ディレクトリに送信できます。環境に合わせて URL とテスト名を変更すると、QTP が呼び出され、結果が target/qtp/results.html に配置されます。これは、QTP で必要なすべてを実行するために呼び出すことができる単一のテストがあることを前提としています。
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>test</phase>
<configuration>
<tasks>
<get verbose="true" src="http://[servername]/qtp/LaunchQTP.plx?testname=[test name]"
dest="${project.build.directory}/qtp/results.html" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Jenkins用のQualityCenterプラグインを試すことができます:https ://wiki.jenkins-ci.org/display/JENKINS/Quality+Center+Plugin
私はこのvbscriptを使用しています
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
qtApp.Open "<fullpathto>\XlTest", True ' Open the test in read-only mode
' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Run ' Run the test
qtTest.Close ' Close the test
qtApp.Close ' Close the app
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
私が直接呼び出す