Introducing React ReExt – Sencha Ext JS Components in React! LEARN MORE

Sencha Test Tip: Execute Tests on Multiple Browsers Simultaneously

May 11, 2017 110 Views
Show

The Ext JS framework includes the most comprehensive collection of high-performance components for building your apps. And, you can create robust test automation strategies using Sencha Test to test components rather than relying on the visible elements in the Document Object Model (DOM). The Sencha Test API layer provides easy access to Ext JS components with specific API methods that allow you to write concise tests.

Upcoming webinar
Join us for our upcoming webinar on using Sencha Test and Sauce Labs, where we’ll provide real-world examples. You’ll learn how to scale the automated test suite to over thousands of test cases and cross-browser combinations for a complete regression cycle.
Register Now
May 17, 2017
10am PDT | 1pm EDT | 6pm BST

4 Ways to Run Tests on Multiple Browsers

There are four ways to run tests on multiple browsers. You can choose from:

  • Sencha Studio Test Runner on local browsers
  • Sencha Studio Test Runner on an embedded browser/Selenium configuration
  • Selenium Grid infrastructure
  • Browser Farm such as Sauce Labs or BrowserStack

Cross Browser Test Execution – In-Browser Scenario

Sencha Studio’s Test Runner is a very powerful component. If you’re testing a single page application, you can simply create an in-browser scenario, and the Test Runner will automatically scan and make all major local browsers available for test execution.

Sencha Test - Cross Browser Test Execution

Now, simply select the browser you want or select-all and execute tests. This is the easiest way to execute tests on multiple browsers simultaneously.

Cross-Browser Test Execution – WebDriver Scenario

If you’re testing a multi-page application, the in-browser scenario is not the best solution. Instead, start by creating a WebDriver scenario in Sencha Studio. If you’re running in developer mode, the option to choose a WebDriver scenario will be under the “Scenario Settings > Advanced” section. If you’re running in test automation engineer mode, “WebDriver” is the only available scenario.

The Test Runner has an embedded browser (Chrome) and an embedded Selenium server within Sencha Studio. This allows you to execute and debug tests before running them on multiple browsers. In order to run tests on multiple browsers simultaneously, you need a Selenium Grid or a connection to a Browser Farm. Sencha Test has been configured to work out-of-the-box with Selenium Grid and Browser Farms. Sencha Studio provides an easy way to enter the required credentials to access the grid or farm and start using it very quickly. This week, we’ll look at how to execute tests on browser farms.

Creating the Browser Farm

  1. In Sencha Studio, navigate to the “Browsers” tab
  2. Sencha Test - Sencha Studio Browsers Tab

  3. Click on the “Add” button and select Sauce Labs
  4. Provide a name for the browser farm. In this case, we’re calling it “SauceLabs-Connection”
  5. A success message will be displayed
  6. Once the farm is created, click on it and a screen with user credential information will be displayed
  7. The default hostname and port for Sauce Labs will be prepopulated
  8. Enter the username and the access key from the Sauce Labs account details page
  9. Select the total number of virtual machines (VMs) to be spun up for test execution

Creating the Pool

Now that the farm is created, we need to select the browsers that we want to test against and create a pool. The pool name will be used for running tests from Sencha Studio Test Runner as well as Sencha Test Command Line Interface (CLI).

  1. Create a pool and make sure that it’s stored within the workspace
  2. Once the pool is added successfully, add browsers to the pool
    1. Provide some basic information about browsers that you’re selecting, e.g. browser version, operating system, etc.
    2. Click Save
    3. Add all the required browsers and save the config

    Sencha Test - Creating the Pool

  3. Reopen the test project, and you’ll see this config is now available within the Test Runner
  4. Sencha Test - Cross-Browser Testing Config in TestRunner

  5. The pool can be used from within Sencha Studio or in the Sencha Test CLI. Read the documentation for using the CLI.
  6. The browser pool created can be used with any scenario created under this test project.

Sencha Test - Testing with Browser Pool

A similar process can be used to set up a browser pool using BrowserStack.

Cross-browser test automation is very important, especially for consumer-facing applications. Sencha Test allows you to run the same test across multiple browsers without having to explicitly code browser-specific instructions.

Our Tip of the Week emails provide you with a variety of best practices and tips and tricks, so you can get up to speed quickly on using Sencha Test. Sign up now.

Get more information about other Sencha Test APIs. Share your feedback and questions in the Sencha Test forum.

Happy Testing!

Show
Start building with Ext JS today

Build 10x web apps faster with 140+ pre-build components and tools.

Latest Content
Discover the Top 07 Architecture Patterns used in Modern Enterprise Software Development
Discover the Top 07 Architecture Patterns used in Modern Enterprise Software Development

Developing software without an architecture pattern may have been an option back then. However, that’s…

JavaScript Design Patterns: A Hands-On Guide with Real-world Examples
JavaScript Design Patterns: A Hands-On Guide with Real-world Examples

As a web developer, you know how popular JavaScript is in the web app development…

Virtual JS Days 2024のハイライト
Virtual JS Days 2024のハイライト

2024年2月20日~22日、第3回目となる「Virtual JavaScript Days」が開催されました。JavaScript の幅広いトピックを採り上げた数多くのセッションを実施。その内容は、Senchaの最新製品、ReExt、Rapid Ext JSまで多岐にわたり、JavaScriptの最新のサンプルも含まれます。 このカンファレンスでは多くのトピックをカバーしています。Senchaでセールスエンジニアを務めるMarc Gusmano氏は、注目すべきセッションを主催しました。Marc は Sencha の最新製品「ReExt」について、詳細なプレゼンテーションを実施。その機能とメリットを、参加者に理解してもらうべく詳細に説明しました。 カンファレンスは、Senchaのジェネラルマネージャを務めるStephen Strake氏によるキーノートでスタートしました。キーノートでは、会社の将来のビジョンについての洞察を共有しています。世界中から JavaScript 開発者、エンジニア、愛好家が集まるとてもエキサイティングなイベントとなりました。これは、JavaScript…

See More