TeamCity
TeamCity is a Java-based build management and continuous integration server from JetBrains. You need to install TeamCity in order to execute offline package using TeamCity.
TeamCity Installation
Follow the below-mentioned steps to install TeamCity.
- Download Team City and JRE 6,7/JDK 1.6,1.7.
- Install JRE 6, 7/JDK 1.6, 1.7.
- Right-click the Team City setup.exe and click Run as Administrator.
- Follow the on-screen installation steps.
- Post-Team City installation, install TeamCity agent as well.
- Navigate to services.msc and stop TeamCity Agent service.
Launch the Command Prompt as administrator and execute the agent.bat file.
Please note that TeamCity needs to be started using agent.bat command only. If you use TeamCity as a service, you won’t be able to see the browser during test case execution.\
- Once the setup is complete, access TeamCity URL (http://localhost:<port> defined when installation).
If Client and Server are on two different systems then the user should run the client manually using the command prompt with the administrator privileges (that is Run as Administrator).
TeamCity Configuration
To configure TeamCity:
- Access Team City URL. (http://localhost:<port>)
- Create a new project.
- Under the Build Configurations section, click Create build configuration.
- Enter Name.
- Enter Artifact Paths as:- QualitiaReport/**/* => Report.
Please do not update any other field in this section. - Click, VCS Settings > create and attach new vcs root.
- Select Type of VCS as Subversion.
- In the URL field, update SVN URL till parent folder location where XML's and Offline Package is uploaded.
- Enter SVN credentials in the Username and Password fields.
- Click Test Connection to test SVN connection.
Please do not update any other field in this section. - Click Add Build Step.
- Select Runner Type as Command Line.
- Select Execute Step as per user understanding.
- In the Run drop-down list, select Executable with parameters.
- In the Command executable field, enter %system.teamcity.build.workingDir%<followed by Offline Package path on SVN>.
- Add another line in the Command executable field as QualitiaOffline.exe.
- Click Save.
This will execute the offline package. - Click Build Parameters.
- Click Add new Parameter.
- Select Kind as Environment variable from the drop-down list.
- Enter Name as env.qualitiareportpath.
- Click Build Step.
- Click Add Build Step.
- Select Command Line from the drop-down list.
- Enter the build name as per user understanding.
- From the Run drop-down, select Custom script.
- Enter the Custom Script field as follows:
xcopy /I /Y /E %env.qualitiareportpath%\* .\QualitiaReport. - Click Save.
Execution and Reports
Once configured successfully, you can proceed for executions using TeamCity.
To execute your test cases in TeamCity:
- On the top right corner, click Run.
- Click Build in Progress and go to the Build Logs section to check the logs.
- Once the build is complete, the user would see Build Finished towards the end of the logs.
- Click the Artifacts link to see the report in the browser.
Click SummaryReport.html to view the report.
User can even pass arguments and execute the same TC with different parameters on different agents simultaneously.
- To adjust settings, navigate to the Build Step section.
- Edit the Execute Parameter step.
Following the updated value in the field, add the argument with respective data followed by SPACE.
Here is an example of how to update the field value along with parameters and the syntax to be used, if the arguments value itself has space.
<path updated in the field> CaptureFailBitMap=False CapturePassBitMap=False CreateErrorLog=False sbrowsertype=firefox "xmlPath=f:\\TeamcityOffline\\NewExec XMLs" ReleaseNum=2.01 ProjectName=offlinepack LogPath=argreport123
Argument with a value consisting space is updated within ‘ “ ‘ (double quotes). Qualitia doesn’t recommend changing these values as changing following values has a major impact on the offline execution.
ToolName=QTP and DryRun=False.