Documente Academic
Documente Profesional
Documente Cultură
The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Microsoft grants you a license to this document under the terms of the Creative Commons Attribution 3.0 License . All other rights are reserved.
Page 2 of 49
Table of Contents
Introduction ...................................................................................................................................................................................................................................... 4 Overview ....................................................................................................................................................................................................................................... 4 Visual Studio ALM Rangers ................................................................................................................................................................................................... 4 Contributors ................................................................................................................................................................................................................................ 4 Personas ........................................................................................................................................................................................................................................ 4 Related Resources..................................................................................................................................................................................................................... 4 Exercises ........................................................................................................................................................................................................................................ 5 Device testing approach for IT Applications ....................................................................................................................................................................... 6 Need for Device Testing ......................................................................................................................................................................................................... 6 Challenges in Device Testing ..................................................................................................................................................................................................... 7 Device Testing Lifecycle for IT Applications (DTL-IT) ................................................................................................................................................. 7 Envision Phase ............................................................................................................................................................................................................................ 7 Plan Phase .................................................................................................................................................................................................................................... 8 Build Phase................................................................................................................................................................................................................................ 11 Stabilize Phase ......................................................................................................................................................................................................................... 14 Native App Best Practices ................................................................................................................................................................................................... 14 Environmental preparation ...................................................................................................................................................................................................... 16 Installing the Perfecto Mobile Team Foundation Server (TFS) add-in............................................................................................................. 16 Accessing the Perfecto Mobile Cloud Platform ........................................................................................................................................................ 17 Hands-On Lab ............................................................................................................................................................................................................................... 20 Exercise 1 Accessing the Perfecto Mobile Cloud and running an automated test (10 min) .............................................................. 20 Exercise 2 Run an automated test in the Perfecto Mobile Cloud within Visual Studio (15 min) ...................................................... 26 Exercise 3 Run an automated test in the Perfecto Mobile Cloud within Microsoft Test Manager (10 min) ................................ 31 Exercise 4 Continuous Integration - Run an automated test in the Perfecto Mobile Cloud within Team Build on TFS (10 min) .............................................................................................................................................................................................................................................. 38 Exercise 5 Continuous Integration - Run an automated test in the Perfecto Mobile Cloud within Team Build on Team Foundation Service in the cloud (10 min) .................................................................................................................................................................... 41 Conclusion ...................................................................................................................................................................................................................................... 45 Appendix ......................................................................................................................................................................................................................................... 46 Automation Tool Comparison .......................................................................................................................................................................................... 46 FAQ .............................................................................................................................................................................................................................................. 48
Page 3 of 49
Introduction
Overview
How do you develop and test apps on iOS, Android, and Windows Phone devices? You leverage the Visual Studio Industry Partner (VSIP) solutions and our Team Foundation Server (TFS) integrations. For example, for IOS and Android development, use solutions from ITRMobility and Xamarin to develop within the Visual Studio IDE using .NET. You can use Xcode, Eclipse, or IntelliJ and integrate with Team Foundation. Then you test your mobile application using Perfectos Mobile Cloud solution. Mobile applications can require complex testing on specific devices for which the acquisition and maintenance can be expensive. Especially for devices based on Android as there are so many variations. Emulators are useful but can be expensive and inaccurate. The best solution is to test your mobile applications on the actual device using Visual Studio Application Lifecycle Management (VS ALM) and TFS tooling enabling an end-to-end Application Lifecycle Management (ALM) experience. Deploying your application on the actual device, testing from anywhere globally, and integrating with Visual Studio and TFS provides incredible business value. The following guidance will describe how to install and setup Visual Studio and TFS to use the Perfecto Mobile MobileCloud for TFS solution. The document also describes how to use the Perfecto Mobile solution within the Visual Studio 2012 RTM ALM Virtual Machine or your own VM or local desktop. In addition, we will discuss the architecture, the mobile cloud, testing of real devices, ScriptOnce, the integration with Visual Studio and Microsoft Test Manager, and the end-to-end scenario.
Contributors
Anil Chandra Lingam, Anisha Pindoria, Brian Blackman, Dan Marzolini, Esteban Garcia, Hassan Fadili, Mathew Aniyan, Oliver Hilgers, Bipin Puthiyaveetil, and Ranjit Gupta.
Refer to Visual Studio ALM Rangers Personas and Scenarios 2 for more information about the personas and customers profiles referenced in this guide.
Related Resources
Understanding the ALM Rangers http://aka.ms/vsarunderstand Visual Studio ALM Rangers Home Page http://aka.ms/vsarmsdn Visual Studio ALM Ranger Solutions http://aka.ms/vsarsolutions Visual Studio ALM Ranger Solution vsarDeviceTest Project on Codeplex - http://aka.ms/vsardevicetest
1 2
http://aka.ms/vsarindex http://go.microsoft.com/fwlink/?LinkID=230942
Page 4 of 49
Exercises
The Hands-on lab sections will show you how to use the Perfecto Mobile platform and Visual Studio to test different mobile devices through automated scripts as a manual or general tester. The lab will take approximately 55 minutes to complete. The hands-on lab is structured for you to learn how to: 1. 2. 3. 4. 5. Run an automated test script on the perfecto mobile cloud and review the test results. Create your own Visual Studio Perfecto Mobile Cloud project and run tests against real mobile devices in the cloud. Run an automated test script against real mobile devices in the cloud within Microsoft Test Manager 2012. Run an automated test script within a Continuous Integration process on TFS Team Build. Run an automated test script within a Continuous Integration process on Team Foundation Service Build in the cloud.
This guide targets the Microsoft 200-300 level users of Visual Studio 2012. The target group is considered as intermediate to advanced users of Visual Studio 2012 and has in-depth understanding of the product features in a real-world environment. Parts of this guide may be useful to the Visual Studio novices and experts but users at these skill levels are not the focus of this content.
WARNING
The mobile device environment might change. Please read the next paragraph carefully.
The exercises run on real devices in the Perfecto Mobile Cloud. As real mobile devices are subjected to software updates and other environmental changes over time, it is possible that tests could on occasion fail. Therefore, if a test execution in the exercises fails the root cause can be different. Here are some examples:
Possible error scenario The URL https://demo.perfectomo bile.com is not available anymore. The test fails with an error due to a device error. Possible root cause The demo environment is not available anymore and the production environment can be used in a trial mode. The referenced mobile device in the exercise doesnt exist anymore. is disconnected. has a new device ID. is locked or blocked by another user. Solution Use another URL in the exercises and Visual Studio Code: Use the production environment URL: https://www.perfectomobile.com. Validate the mobile device status: Please check the portal https://demo.perfectomobile.com in the area Interactive / Select Device and validate the device status. If the needed device has an issue use another available device. For the exercise the device ID (DUT), device name and OS name (os) are needed and must be changed. Then retry the exercise / test execution. Validate the app status on the mobile device: If the ATM app doesnt exist on the mobile device please contact the Perfecto Mobile support. Validate the mobile device screen: Close the pop up message without executing the OS device update and retry the exercise / test execution.
The test fails with an error due to an app error. The test fails with an error due to an OS update pop up on the device start screen.
The ATM app is not installed on the selected device. A pop up message on the device shows that an OS update is available. So, the tests script cannot select the ATM app icon anymore.
For additional help please contact the Perfecto Mobile support: http://www.perfectomobile.com.
Page 5 of 49
Page 6 of 49
Define scope Conduct Automation Assesement/ROI Define test spread based on schedule Create Device Testing Strategy Define Test Sceanrios
Test Spread: Define the % effort in emulators, manual and cloud-based testing.
Envision Phase
How to select the minimum set of devices to be device tested?
Selecting the minimum set of devices that needs to be device tested is the most challenging aspect of device testing. This would depend on factors such as platform to be supported, business usage of the application and market data consideration for device market. For a typical web application that will be consumed on multiple devices would have the following device priority matrix:
Page 7 of 49
Depending on the usage of your application, define the device priority matrix and arrive at a set of devices on which testing needs to be performed. Make sure that, you are choosing only those devices that are critical to your business. This activity needs to be done during the planning phase. Also, given the dynamic nature of device market, if time period between planning phase and SIT phase is significant, then re-evaluate the device priority matrix on every iteration, so that you are including the new devices that have just arrived to the market in your test mix. Another strategy for testing the application on multiple devices is to do Beta Release of the application and do dog-fooding.
Plan Phase
Figure 3 - Testing types across various layers for optimizing the efforts
Following are the key activities that needs to be performed during Plan phase: Define User Scenarios for the IT application
Page 8 of 49
Device support strategy 1) How many of the platform and devices should we support? 2) Business Considerations 3) Market data considerations 4)Failing gracefully when a device is not supported
Recommendations
1) First Test on the major Desktop browsers to ensure that the system is functionally stable (VS 2012 Coded UI Selenium support will help for Automation) 2) Run the tests on major platform/devices Emulators (Automation/ Manual based on ROI) 3) If the devices are available then test on real device. Set of Reference devices in-house shared by the team. Test at least once all the scenarios in the reference devices manually
Page 9 of 49
Based on the combinations identified one can make use of combinatorial algorithms to decide the optimum combinations of tests to be designed to ensure greater coverage and eliminate risks.
Emulators/Browser plug in based testing will be the most cost effective solution. The above pyramid helps make the decision based on the cost factor. This also depends on the number of devices in our test spread and the
Page 10 of 49
Automation guidelines
Automation on Virtual Device is recommended for the following areas
1) Any scenario that can be run on an emulator can be automated and can be tested without the real device .Identify the regression suite for the functional test cases and we can automate those scenarios for all the gestures to ensure that the major risks and coverage issues are addressed as part of early iteration testing and regression tests are automated as part of iteration scope .Majority of the emulators comes free. 2) Automation on Real device is recommended in early stages of the application life cycle to detect and fix the bugs early. 3) Anything that can be run on a emulator for all the top 4 platform/devices 4) Performance and Stress testing on actual devices 5) Some Configuration testing on Emulators 6) Standard out of the box compliance check/design guidelines check
Build Phase
Following are the key activities that needs to be performed during Build Phase: Identify the test scenarios based on functional and non-functional requirements
Page 11 of 49
Identify the priority scenarios which can be automated based on the return on investment (ROI)
W3c Mobile OK
Iphoney
Iphoney
Page 12 of 49
2.
3.
4.
Stabilize Phase
Following are the key activities that needs to be performed during the Stabilize Phase: Execution of test cases on emulators and real devices as per the Test Spread Run the Tests Publish the Test Report
Page 15 of 49
Environmental preparation
In this section, we will cover the pre-requisites and installation of the MobileCloud for TFS template for Visual Studio. Your options are to install the MobileCloud for TFS to your desktop where you have Visual Studio installed or to a Virtual Machine with Visual Studio. MobileCloud for TFS integration with unit testing does not require TFS. MobileCloud for TFS integration with Microsoft Test Manager does require TFS. The following guidance will at times seem like a hands on lab, however, some detail is needed as we explain what is needed to use the MobileCloud for TFS with Visual Studio and TFS. In order to run Perfecto Mobile scripts from your development environment, you first install the Perfecto Mobile Cloud for TFS Test Template. The installer creates a Project Template on C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\Test and places Perfecto Mobile assemblies on C:\Program Files (x86)\PerfectoMobile\Visual Studio. This location is configurable during installation. Test projects created using the Mobile Cloud Project template use the installed TFS Adapter to make calls to the Perfecto Mobile service.
Visual Studio 2012 + Update 2 or higher Microsoft Test Manager 2012 (required for integration with Test Case) TFS 2012 Update 2 (if on-premise deployment) or Team Foundation Service 3 in the cloud SQL Server 2008 / 2012 (if on-premise deployment) Perfecto Mobile Account - https://www.perfectomobile.com/trial/sign_up
A user account is required to use the MobileCloud for TFS. This guidance and the HOL exercises assume you have your own account.
For additional information, you may access the following resources: Microsoft Test Manager 2012: http://msdn.microsoft.com/en-us/library/vstudio/dd380763.aspx Team Foundation Server 2012: http://msdn.microsoft.com/en-us/vstudio/ff637362.aspx
http://tfs.visualstudio.com
Page 16 of 49
Once these steps have been completed successfully, the Perfecto Mobile TFS Add-in can be installed following the instructions detailed in the Local installation section.
http://aka.ms/almvms
Page 17 of 49
This link takes you to Perfecto MobileCloud registration page where you supply your registration information.
NOTE
Make note that the web page screen shots of the partners web site is subject to change from what we have shown you in this guidance.
Page 18 of 49
Once the I Accept button has been clicked, the relevant login credentials will be sent to the supplied email address. User credentials are activated and can be used immediately.
Page 19 of 49
Hands-On Lab
If you are intending to follow the Hands-on Lab (HOL) step by step, use these times for each exercise as a guideline. If, however, you are intending to investigate each step in detail double the times as a bare minimum.
NOTE
This hands-on lab includes the following exercises: 1. 2. 3. 4. 5. Accessing the Perfecto Mobile Cloud and running an automated test Run an automated test in the Perfecto Mobile Cloud within Visual Studio Run an automated test in the Perfecto Mobile Cloud within Microsoft Test Manager Continuous Integration - Run an automated test in the Perfecto Mobile Cloud within Team Build on TFS Continuous Integration - Run an automated test in the Perfecto Mobile Cloud within Build Service on Team Foundation Service in the cloud Estimated time to complete this lab: 55 minutes.
Exercise 1 Accessing the Perfecto Mobile Cloud and running an automated test (10 min)
GOAL
1. 2.
NOTE
In this exercise you will use the perfecto mobile cloud, to run a predefined automated test against the Bank of America app on a specific mobile device. This automated script will run a functional test.
Persona Mapping
This exercise is focused on Christine as a tester.
Exercise
If using the Brian Keller TFS 2012 Demo Virtual Machine5, you can log on as Julia Ilyiana with the standard password P2ssw0rd. Open Internet Explorer and browse to the URL https://demo.perfectomobile.com. Log on with your username and password.
If you dont have an account, please request your own demo account under: https://www.perfectomobile.com/trial/sign_up.
3.
NOTE
5
http://aka.ms/BrianKellerAlmVms
Page 20 of 49
5. 6.
Select folder Public Scripts\Microsoft\ and open the script search_for_atm. The file is a script for test automation and contains different automated test steps:
7.
Click Running View to switch to the test steps execution status view.
Page 21 of 49
10. The test execution starts and the status for each test step :
11. Click Watch in the menu bar while the test is running to switch to the Devices Live video view:
Page 22 of 49
NOTE
The test script runs through the sign in process of the Mobile Banking app and finds the ATM location nearest to a specific zip code.
12. When the test script completes successfully a test report is available. Click Yes to review the report results.
Page 23 of 49
14. Click on Execution Sequence to review the individual test steps and recorded screenshots. Scroll down to the last Text checkpoint to verify, that the expected text values Expected text (needle): sign in was found in the loaded app page and that the elapsed test step time didnt reach the set value for Timeout: 40 sec.
Page 24 of 49
15. OPTIONAL: Click also on Errors to see if any errors occurred during test execution (should be empty in our case). 16. OPTIONAL: Click also on Statistics to get an overview about the passed vs. failed Checkpoints and Actions.
This exercise you ran an automated functional test against the mobile banking app provided by the company Bank of America. For testing you used the perfecto mobile cloud. You have learned how to open an existing test script and run that automation scripts against a selected mobile device. The generated test run report enabled you to verify the test run in detail.
REVIEW
Page 25 of 49
Exercise 2 Run an automated test in the Perfecto Mobile Cloud within Visual Studio (15 min)
In this exercise you will run a predefined automated test against the Bank of America app on a specific mobile device using Visual Studio. You will code an automated test that will access the perfecto mobile cloud and will run an automated test script as a functional test.
Persona Mapping
This exercise is focused on Christine as a tester.
Exercise
If using the Brian Keller TFS 2012 Demo Virtual Machine6, you can log on as Julia Ilyiana with the standard password P2ssw0rd. 1. 2. From within Visual Studio, create a new project via Ctrl+Shift+N. Select the Mobile Cloud Project template for Visual C# in the folder Installed -> Templates -> Visual C# -> Test and click OK:
GOAL
NOTE
If dont see the Mobile Cloud Project template, please install the perfectomobile-tfs-add-in-installer-1.0 extension for Visual Studio 2012.
3.
Open code file MobileCloudTest1.cs and overwrite the string values for mobileCloudServer, user and password in the public class MobileCloudTest1 with the following values:
// URL of the perfecto mobile cloud static String mobileCloudServer = "https://demo.perfectomobile.com/"; // user name, used for logon static String user = "<your username>"; // password, used for logon static String password = "<your password>";
Code 1 Parameters to initialize a connection to the perfecto mobile cloud.
http://aka.ms/BrianKellerAlmVms
Page 26 of 49
Overwrite the string values scriptKey and DUT and add a parameter os in the test method ExecuteScript1():
// path to the automate test script in XML format String scriptKey = @"PUBLIC:Microsoft/search_for_atm.xml"; // Device ID of the emulated mobile device String DUT = "C1C30569F52259AD3E081816C30E54457DA55400"; // expected OS of the emulated mobile device String os = "iOS"; Dictionary<String, String> runTimeParameters = new Dictionary<String, String>(); // if needed, add additional runtime parameters below the DUT parameter runTimeParameters.Add("DUT", DUT); runTimeParameters.Add("os", os); // execute script with mobile cloud adapter adapter.Execute(scriptKey, TestContext, runTimeParameters, MobileCloudAdapter.REPORT_FORMAT_HTML);
Code 2 Coded start parameters for the test method ExecuteScript1.
NOTE
The value for the parameter DUT means the Device ID. You can find this Device ID in the perfecto mobile cloud portal in the list of devices as a separate column.
4. 5.
Build the solution with Ctrl + Shift + b and select TEST -> Windows -> Test Explorer in the menu to open the Test Explorer. Now you can see the test method ExecuteScript1 in the Test Explorer. To run the test method right click on ExecuteScript1 and select Run Selected Tests:
Page 27 of 49
Figure 16 See test execution on the real device in the cloud dashboard.
7.
After a while you will see the test result. The test method ExecuteScript1 passed. Click on the link Output to open the test result in a separate view:
Page 28 of 49
9.
Scroll down to see the execution time for each test step in the area Execution Sequence:
Page 29 of 49
10. Scroll down to see the device information in the area Devices and click on the link Video ():
In this exercise you ran an automated functional test within Visual Studio against the mobile banking app provided by the company Bank of America. For testing you used the perfecto mobile cloud. You have learned how to create a new Visual Studio Mobile Cloud project. You modified the provided test code to execute an existing test script and run that automation script against a selected mobile device. The generated html based test sequence report enabled you to verify the test run in detail. The recorded test execution video was helpful to visually verify the test execution on the mobile device.
REVIEW
Page 30 of 49
Exercise 3 Run an automated test in the Perfecto Mobile Cloud within Microsoft Test Manager (10 min)
The Perfecto Mobile Cloud can also be accessed from within a Microsoft Test Manager (MTM) test case. In this exercise, you will create a test case and enable automation using the unit test you created in exercise 2 so that you can see the end to end ALM integration for mobile device testing. Microsoft Test Manager requires integration with TFS where unit testing does not. The test project and unit test file created in Exercise 2 will need to be checked into your TFS repository so that the test plan you create can access the unit test.
Persona Mapping
This exercise is focused on Christine as a tester.
Exercise
If using the Brian Keller TFS 2012 Demo Virtual Machine7, you can log on as Julia Ilyiana with the standard password P2ssw0rd. 1. 2. From within Microsoft Test Manager, under the Plan tab, create a new test case. Enter the title of the Test Case. There is no need to add any Test Steps.
NOTE
GOAL
NOTE
The automation status of the Test Case is set to Not Automated. You will need to use Visual Studio to add the associated automation as listed in the following guided steps.
3. 4.
After saving your test case, open Visual Studio and query the test case previously created. Navigate to the Team menu item in the menu bar within Visual Studio, click on Go to Work Item and provide the id number for the test case that was created in Microsoft Test Manager.
http://aka.ms/BrianKellerAlmVms
Page 31 of 49
6.
Click on the ellipse button. The test name previously created should appear. Highlight the test name and click OK as shown below.
Figure 25 MTM: Associate the test case with the test script.
Page 32 of 49
You will now need an Environment to run the test case with automation. If you do not have an Environment, you will need to create one. If you do not have an Environment configured, the following steps will guide you through the process of creating a new environment to run the Test Case.
NOTE
8.
Within Microsoft Test Manager, navigate to the Lab Center, select the Lab tab, and click New:
Page 33 of 49
10. In the Machines tab, select Add Machine. 11. Provide the name of the computer from where the tests will run. 12. Follow the steps and click Verify:
13. Once verification is complete, a new Environment is created and initialized in a running state. 14. The Environment can now be used by associating it in the Test Settings tab in the Lab Center. 15. Within Lab Center, select the Test Settings tab.
Page 34 of 49
17. Click Next to navigate to the Roles tab and select the Environment created previously. 18. Click Finish to create a new Test Setting. The completed Test Setting is shown below:
19. Next, navigate back to the Test Center and click on the properties in the Plan tab. 20. Select the Test Settings and Test Environment created previously.
Page 35 of 49
22. Navigate to the Test Lab in Test Center and under Run select Run with options. Pick the selection that was created in the properties section and click Run as shown below.
Page 36 of 49
Figure 35 See test execution on the real device in the cloud dashboard.
Allow enough time for the test to pass depending on your network connection. A successful test run is shown below.
The Perfecto Mobile Cloud for TFS add-in will attach the test results to the test case run. Once again, the results are an html file showing the sequences as they were executed within the Perfecto Mobile Cloud. This is shown below:
Page 37 of 49
In this exercise you created a test case and enabled automation of the functional test within Visual Studio against the mobile banking app provided by the company Bank of America. For testing you used the perfecto mobile cloud. You have learned how to integrate a test created in a Visual Studio Mobile Cloud project with Microsoft Test Manager. The generated html based test sequence report enabled you to verify the test run in detail.
Exercise 4 Continuous Integration - Run an automated test in the Perfecto Mobile Cloud within Team Build on TFS (10 min)
The Perfecto Mobile Cloud can also be accessed from within a Team Build. In this exercise, you will create a new build definition and enable testing within Continuous Integration using the unit test you created in exercise 2 so that you can see the end to end ALM integration for mobile device testing during the build process. Continuous Integration requires integration with TFS. The test project and unit test file created in Exercise 2 will need to be checked into your TFS repository so that the Team Build can access the unit test. Follow the steps from the Exercise 2 on the Hands-on Lab first to create a Mobile Cloud Project in Visual Studio and start with this Exercise.
Persona Mapping
This exercise is focused on Christine as a tester.
Exercise
If using the Brian Keller TFS 2012 Demo Virtual Machine8, you can log on as Julia Ilyiana with the standard password P2ssw0rd. Before running Perfecto Mobile test cases as part of a Continuous Integration build with Team Foundation Server, the solution from Exercise 2 must be checked-in to TFS Source Control by following these steps: 1.
8
NOTE
GOAL
REVIEW
http://aka.ms/BrianKellerAlmVms
Page 38 of 49
3.
On the Add Solution to Source Control dialog, select a Source Control Path and click OK:
4.
Page 39 of 49
6.
Once the solution is checked in, create a new build definition by going to the Builds tab in Team Explorer and clicking on New Build Definition:
Provide a Name for the new Build Definition and select all the defaults. On the Process tab, verify that your solution is set as the value for Projects to Build. Expand the Automated Tests section in the build definition, then Test Source and make sure that the Test Source Spec argument includes the name of your test assembly. By default, this value is **\*test*.dll. If you selected the default name when creating the Perfecto solution, your assembly name will be Mobile Coud Project1, which wo uld not be picked up by the build process. You should update this value to **\**.dll.
Page 40 of 49
You may now queue the build and your Perfecto Mobile test case will run during the build.
Exercise 5 Continuous Integration - Run an automated test in the Perfecto Mobile Cloud within Team Build on Team Foundation Service in the cloud (10 min)
The Perfecto Mobile Cloud can also be accessed from within a Build based on Team Foundation Service in the cloud. In this exercise, you will create a new build definition and enable testing within Continuous Integration using the unit test you created in exercise 2 so that you can see the end to end ALM integration for mobile device testing during the build process. The difference between this Exercise 5 and the Exercise 4 before is, that Continuous Integration will now run in the cloud. Continuous Integration requires integration with TFS. The test project and unit test file created in Exercise 2 will need to be checked into your TFS repository so that the Team Build can access the unit test. Follow the steps from the Exercise 2 on the Hands-on Lab first to create a Mobile Cloud Project in Visual Studio and start with this Exercise.
Persona Mapping
This exercise is focused on Christine as a tester.
Exercise
If using the Brian Keller TFS 2012 Demo Virtual Machine9, you can log on as Julia Ilyiana with the standard password P2ssw0rd. When you install Perfecto Mobile on a development machine, a set of assemblies get copied to C:\Program Files (x86)\PerfectoMobile\Visual Studio. Since Perfecto Mobile cannot be installed on TFS Service, those
http://aka.ms/BrianKellerAlmVms
NOTE
GOAL
Page 41 of 49
Before running Perfecto Mobile test cases as part of a Continuous Integration build, the solution must be checked-in to TFS Source Control by following these steps: 1. From Solution Explorer, Right-click on the solution and select Add Solution to Source Control:
Page 42 of 49
3. 4.
Right-click on the solution again and select Check In. In the Pending Changes tab of Team Explorer, enter comments and click on Check In:
5.
Once the solution is checked in, create a new build definition by going to the Builds tab in Team Explorer and clicking on New Build Definition:
Page 43 of 49
Provide a Name for the new Build Definition and select all the defaults. On the Process tab, verify that your solution is set as the value for Projects to Build. Expand the Automated Tests section in the build definition, then Test Source and make sure that the Test Source Spec argument includes the name of your test assembly. By default, this value is **\*test*.dll. If you selected the default name when creating the Perfecto solution, your assembly name will be Mobile Coud Project1, which would not be picked up by the build process. You should update this value to **\**.dll.
You may now queue the build and your Perfecto Mobile test case will run during the build.
Page 44 of 49
Conclusion
We have shown you how easy it is to integrate the Perfecto Mobile Cloud for TFS with Visual Studio. Testing of your mobile application running on real devices in the cloud is possible as strictly unit tests or as automation tests associated to a test case in Microsoft Test Manager. These integration points allow these tests to be run as part of a build definition for daily, manual, or continuous integration builds. This integration provides the test status reporting features, like status of tests (pass/fail) along with the failure reason. This document does not cover the setup details required to develop for iOS, Android, or Windows Phone. Team Explorer Everywhere 10 is required to enable developing and building Android and iOS applications. For an overview of the lifecycle with Mobile Cloud see the overview poster for this ALM Ranger project.
10
http://msdn.microsoft.com/en-us/library/gg413285.aspx
Page 45 of 49
Appendix
Automation Tool Comparison
Feature Supported Mobile OS SeeTest from Experitest Android iOS Blackberry WindowsPhone8 All emulators are supported See Test does not provide devices. Connect all mobile devices to one central hub/server that resides in your organization to form private cloud Enable remote access from anywhere in the organization to any device Object identification by: Native ID, HTML5-DOM, Image Recognition and Text Recognition Browsers testing Reboot device Awake device from sleep mode Operate device power button Operate device Back, Call/Hang Call, Home, Menu buttons Shell commands for internal device counters (e.g. CPU, memory) Landscape model Object identification by: id, class, text, accessibility Label, accessibility Identifier. Simple recorder Object spy for easy identification of object native properties Easy instrumentation with no code change PerfectoMobile Android iOS Blackberry
Remote Access
Test Coverage
Supports Visual Objects, Native Objects, DOM Objects Get Device Info, state, log Open Device, Reboot device, rotate device Keyboard display Cloud call, SMS, email
Page 46 of 49
Allows simple and intuitive method for pressing virtual locations on touch handsets based on text or image analysis. The system automatically finds those elements, even if their location changes, without any change to the script itself
Gesture Support
Multitouch Swipe Drag & Drop Zoom Scroll inc. conditional scrolling
Keyboard Support
Device keyboard: All configurations (alphabet, punctuation and numbers, and punctuation and symbols) All languages PC keyboard special characters and capitalization
Regardless of the method implemented by the handset (physical or virtual keyboard, different languages, capitalization), simple type text function hides the complexity of any string typing
Page 47 of 49
Full and seamless integration to QC,TFS etc. Capture screenshots and record videos Share test reports with other colleagues and partners, Share devices with others to demo new apps/features, reproduce a bug.
FAQ
Which type of Mobile applications need to be tested on different mobile networks like 2G/3G/4G LTE Conditions? For specialized applications where on location testing for specific cellular networks is to be considered like Free usage allowance or two way SMS Why to test such applications on different mobile networks? Mobile networks have limited bandwidth and high latency (compared to Wi-Fi and broadband) which effects the application performance by increasing the page load time on mobile device resulting in testing an application in real world conditions How to test an application on different mobile networks? Network simulation tools helps in reproducing different network conditions by limiting bandwidth and simulating latency as a result help you in testing whether all mobile users will be getting best user experience in acceptable response times on mobile devices
Page 48 of 49
Page 49 of 49