Can I automatically run QTP tests from Maven / Hudson?

We need to integrate QTP with Hudson to automatically call test suites against code deployed in Hudson. The build process is based on Maven.

Is there any plugin or something for this? We heard about the Groovy plugin for Hudson; Can we execute it with a Groovy script?

+3
source share
5 answers

Hudson does not run tests, he displays the result and generates a good report. You should see how to get Maven to run the tests, and then Hudson to pick up the result to create a report.

+2
source

, Maven, . Maven QTP, exec-maven-plugin . QTP API- "", script. , .

, :

<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>

QTP Ant .


Update:

, . , QTP, , . , antrun plugin 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>
+2

, VBScript, JScript RunTestSet. POM .

  <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>

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>

,
Ramya.

+2

You can try the Quality Center plugin for Jenkins: https://wiki.jenkins-ci.org/display/JENKINS/Quality+Center+Plugin

+1
source

I am using this 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

which I call directly

0
source

Source: https://habr.com/ru/post/1713224/


All Articles