SeeTestAutomation- Creating A Testing Project In Visual Studio
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
In this section we will create a complete testing project that will contain all the resources needed like the repository and the reference libraries. At the end of this section we will upload our project to the TFS server.
Step 1: Connect to the TFS server from the Visual Studio client.
We will navigate to "TEAM"-> "Connect to Team…" to do so and select the IP of the TFS if it exist or add it if it is not. We will add a server by clicking on "Servers…"->"Add". Finally select the collection we created.
Step 2: Create a new team project
After connecting to the collection we will need to create a new project.
- In the "Team Explorer" navigate to "Connect" and click on "New Team Project…"
- Enter the project name and Click next
- Choose "scrum 2.2" and click "Finish"
Step 3: Create a new project
After we had created a new team project on the TFS server we will need to create a new solution that will contain a project (not a team project but a simple project) to upload to it. We will do so by navigating to "File"->"New"->"Project".
Step 4: After selecting the project type that should be a SeeTestAutomation Project using the plug-in, a pop-up dialog should appear (if we are connected to a TFS Server), we will enter the solution name and save it to the TFS server.
Step 5: Import the test you created on SeeTestAutomation to the c# project.
We can create a test on the SeeTestAutomation and import it to the Visual Studio (using the plug-in).
Step 6: Add the repository to the Visual studio
We will add the repository used (if used) in the SeeTestAutomationproject to the Visual Studio project because we will want the project to be runnable from different machines. The project base directory will be the directory we will create in this section.
-
Open the SeeTestAutomation project folder and copy the repository folder ("default" in our example) and the repository .XML (default.xml) file that determine the properties of the repository.
-
Create a new folder in your C# project, Name it "Resources" and paste the files in it.
Step 7: Select the location of the Project Base Directory
In this part we will manage the build location so we will be able to use the SeeTestAutomation repository. We will change the "Project Base Directory" to be the "Resources" folder that going to be built on the TFS default agent machine (our TFS machine). To do so we need the future path of the folder.
-
We will get the path by navigating to "Build"->"Manage Build Controllers"->Agent Properties.
-
Change the location if you wish to. In our example we changed the build destination to be "$(SystemDrive)\SeeTestAutomation which means "c:\SeeTestAutomation in the TFS-Server machine.
-
Change the Project base directory
In this part we will perform the code modification needed for the repository to be enabled. In order to use the SeeTestAutomation repository we need to set the directory to be the path we used in the build- "C:\drop\SeeTestAutomation + "src\<SolutionName>\<ProjectName>\Resources". It will be something like this –
private string projectBaseDirectory = "C:\\drop\\SeeTestAutomation\\src\\SeeTestAutomationsolution\\SeeTestAutomation\\Resources"
Step 8: Copy the SeeTestAutomation client references
The SeeTestAutomation reference "imageClient" and "Cookcomputing" need to be access from the host machine. We need to create a folder (called ‘drop’ in the example) on the TFS-Server machine, share it with "everyone" with " read/write" authorization. We will copy the reference files to the "drop" folder and replace the project references path from the local path to the path of the "drop" folder.
We could use the original path to the reference files (from SeeTestAutomation folder in the "Program Files") but we will have to make them accessible to the client when he try to build the solution.
Step 9: Create a new build definition
In the build definition we are determining the source code to build (like our solution in our case) and the build output destination folder. We are using the build definition for the build in the next phases.
- Navigate to "Build"->"New Build Definition"
- Make sure we are building only our solution in the "Source Setting" tab
- Enter the path of the "drop" folder to the build output location and save the build definition.
Step 10: "Check in" the solution
We need to save our project and Check it in to the TFS-Server so we Check-in the project. If we wish to get the code from the server we will use the "Check-Out" function.
Step 11: Queue new build
Now we are going to build our project on the TFS-Server. There are several things to make sure before building the project:
- For the build to succeed SeeTestAutomation must run on the TFS-Server (even run as a service)
- The device or devices must be accessible to the Agent (the TFS server machine in our example)
- must set the SeeTestAutomation agent port to be just like the port use in the code
We will choose the "Build definition" we created and queue the build.
Step 12: After building the project we need to see a green ‘V’ on the build. If a red ‘X’ is showing then we will click on the failed build and inspect the error cause it.
An example types of errors and exception are:
- UnauthorizedAccessException – somewhere we did not made the folder public
- MappingConflictException – the build controller is in need of relocation due to earlier builds
- And many more…
If the sign of the build result is a orange ‘!’ then the problem might be the test itself that failed – like a click that wasn’t click or something like that.
Step 13: Create a new test case
To use the test we created from the MTM we must create a "Test Case" which is an element MTM can associate to a test run.
-
Navigate to "TEAM"->"New Work Item"->"Test Case".
-
Attach the .dll file by going to the "ASSOCIATED AUTOMATION" and clicking on the "…".
After that we will need to save the "Test Case" so we could attach him to our "Test Plan" in the MTM.