Skip to content

Getting Started

Tal Abraham edited this page Apr 24, 2017 · 3 revisions

This procedure leads you through the Quantum framework in phases:

Phase I - Running sample as is

In this phase, you'll run a single Quantum sample. As you continue to the next phases, you'll learn how to add more tests/scenarios to your test execution. The samples are located under the src/test/java/com.perfectomobile.quantum/features/ folder.

  1. Download Quantum git project.
  2. Run your test.

The sample opens device browser at Google, searches for Perfecto Mobile, enters the site, and searches for Perfecto Object Spy.

Phase II - Parallel execution

To run all samples in parallel, you need to configure the TestNG.xml file, which is located under the src/test/resources/config/ folder.

  1. For each of the test suites (enclosed within ...), set the enabled property value to true.
  2. In the CommunityExample file, replace the USERNAME and PASSWORD with a Perfecto Community account's credentials.
  3. In the testData.json (under the resources/data folder) file, insert credentials for two Perfecto Community accounts.
  4. Run your test in the same manner as before.

This results in running 2 additional samples, both logging into Perfecto Community and searching for "Appium"; one uses hard coded credentials, and the other retrieves them from an external input file.

Phase III - Diversifying test execution

You can set each of the test suites to run on a different type of device, and to include different scenarios. For that, you need to manipulate the contents of the various test suites in the TestNG.xml file. Modify only the test suites not related to the Google sample we started with.

  1. Replace the current tag in the community samples, so that in the CommunityExample.feature sample all tags are @sampletag, and in the CommunityDataDrivenExample.feature sample - @sampletagdd.
    You may of course use other values, or leave the tags as is, but use these tag values for demonstration's sake.
  2. In the TestNG.xml file, set the tag parameter value in one suite to @sampletag, and in the other - to @sampletagdd.
    That means, that the first test suite runs the CommunityExample sample, and the second - the CommunityDataDrivenExample sample.
  3. To vary the devices used for each of the test suites, replace the capability parameter ("driver.capabilities.someCapability") in both suites with
    <parameter name="driver.capabilities.platformName" value="Android"/>.
    Set the value to "iOS" in the second test suite.
    By that, you specify that the CommunityExample sample will run on an Android device (randomly allocated), and the CommunityDataDrivenExample sample - on an iOS device.
    Note: Generally, you can use any of the numerous device selection capabilities.
  4. Run your test in the same manner as before.
    You can follow your test execution on Perfecto Dashboard and see the three samples running on the specified device types.

Phase IV - Viewing test execution results in Perfecto Reporting

All the previous executions were recorded, and may be viewed in Perfecto execution center, Reporting.

Let's proceed to naming your tests, so you can easily detect them in Perfecto Reporting and drill down to examine them in more detail.

  1. In each of the feature files (the samples), set the Feature line at the top to
    Feature: community login sample
  2. Run your test in the same manner as before.
  3. To view the test execution report within Perfecto Reporting:
    • Enter your CQ Lab at https://.perfectomobile.com.
    • Select the Reporting tab, and click the link to Perfecto Reporting (on the right).
    • Login using your CQ Lab credentials.

      All the last execution tests are listed in the Reporting execution center. The feature name you set in the sample before, appears as the test name on the left.
  4. To drill down into any of the specific test executions, click the test to view its Single Test Report for more execution details.

Advanced Quantum features

Quantum has additional features to allow better customization to your specific application:

  • Create your own [Object Repository](Object Repository) file to match your application objects.
  • Create a customized steps file to ease performing actions common in your application operation.
  • Write tests using either BDD or Java.
  • Configure the [TestNG.xml](Quantum TestNG File) to filter the tests to execute and the devices used in the test.

Configuration of the [application properties](The application.properties file) and the [TestNG.xml file](Quantum TestNG File), as well as creating object definitions in the [Object Repository](Object Repository) and creating customized steps, require knowledge of Java, TestNG, and XPath.

ℹ️ The Perfecto plugin enables access to real devices and desktop Web sessions in the CQ Lab, as well as easy-to-use Object Spy for mapping the application objects in the [Object Repository](Object Repository).

Clone this wiki locally