Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Protractor Tutorial 4 – Introduction To Protractor Test Tool & How It Works

Posted on 02/19/2025 By admin

As per official document of Protractor:-

Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.

Three major points about Protractor are:-

  1. Protractor is built on top of WebDriverJS, which uses native events and browser-specific drivers to interact with your application as a user would.
  2. Protractor supports Angular-specific locator strategies, which allows you to test Angular-specific elements without any setup effort on your part.
  3. You no longer need to add waits and sleeps to your test. Protractor can automatically execute the next step in your test the moment the webpage finishes pending tasks, so you don’t have to worry about waiting for your test and webpage to sync.

Protractor is a NodeJS program. So you must have NodeJS installed in your system. It supports Jasmine, Mocha and Cucumber test frameworks.

As per Protractor official documents:-

When working with Protractor, it’s important to keep the following in mind:

  • Protractor is a wrapper around WebDriverJS, the JavaScript bindings for the Selenium WebDriver API.
  • WebDriver commands are asynchronous. They are scheduled on a control flow and return promises, not primitive values.
  • Your test scripts send commands to the Selenium Server, which in turn communicates with the browser driver.

A test using Selenium WebDriver involves three processes – the test script, the server, and the browser. The communication between these processes is shown in the diagram below.

The Selenium Server takes care of interpreting commands from the test and forwarding them to one or more browsers. Communication between the server and the browser uses the WebDriver Wire Protocol, a JSON protocol. The command is interpreted by the Browser Driver.

With Protractor, the test script is run using Node.js. Protractor runs an extra command before performing any action on the browser to ensure that the application being tested has stabilized. For example, let’s look at the following snippet of test code.

element(by.css('button.myclass')).click();

This will result in three commands being sent to the Browser Driver

  • /session/:sessionId/execute_async – First, Protractor tells the browser to run a snippet of JavaScript. This is a custom command which asks Angular to respond when the application is done with all timeouts and asynchronous requests, and ready for the test to resume. This is actually automate wait or sync of Protractor for Angular applications.
  • /session/:sessionId/element – Then, the command to find the element is sent.
  • /session/:sessionId/element/:id/click – Finally the command to perform a click action is sent.

Reference:-

https://www.protractortest.org/#/

https://www.protractortest.org/#/infrastructure

More on Protractor in upcoming posts. Stay tuned and keep learning with me.

#ThanksForReading

Uncategorized

Post navigation

Previous Post: rolling file appender in log4j2
Next Post: REST Assured Tutorial 3 – Static Import in Java

Related Posts

API Testing – Postman – Page 2 Uncategorized
image – Make Selenium Easy Uncategorized
TestNGDownload – Make Selenium Easy Uncategorized
Environment Variables in Postman Uncategorized
May 31, 2017 – Make Selenium Easy Uncategorized
Selenium Frameworks Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark