Saturday, December 15Be an Automation Engineer

Protractor

Protractor vs WebdriverIO vs NightWatch

JavaScript, JS, NightwatchJS, Node.js, Protractor, WebdriverIO

JavaScript is now a popular choice of language for developing web applications. To test the applications developed in JavaScript, there seem too many end to end testing frameworks and tools which help in Unit testing, UI testing. However, to use one of them, one has to go through and analyse each tool and framework to know which suits their application » Continue Reading.

An example using Protractor

Protractor

Protractor is an end-to-end testing framework for AngularJS applications. It interacts with web application as a normal user. It is a wrapper around the WebdriverJs library of Selenium. WebdriverJs library internally uses selenium standalone server to interact with web applications and selenium standalone server in turn talk to individual browser drivers like ChromeDriver, GeckoDriver and SafariDriver etc.. » Continue Reading.

Node.js® Introduction

Installation, JavaScript, JS, Node.js, Protractor, SetUp

To know about node.js, one must know about JavaScript.

About JavaScript

JS aka JavaScript is a functional programming language which is platform independent. It is mostly used by web developers for designing front-end of their applications. It is used by to add interactivity like talking to back-end services. It generally runs on client aka your browser like Chrome, Firefox, Internet » Continue Reading.

Installing node.js and npm on Windows

Installation, JavaScript, JS, Node.js, Protractor, SetUp
Installation

Installing NodeJs and NPM can be done like any other windows application using the installer downloaded from Node.js website.

Steps
  • Download the Windows installer package from Node.js website (nodejs.org).
  • Run the downloaded msi package.
  • Accept the license agreement and click NEXT a few times until you get below screen.
  • Observe that Setup window shows following packages –
  • Run Protractor tests in Firefox using Gecko (marionette) driver

    Protractor

    Firefox is supporting ‘Gecko’ webdriver from FF48. Selenium is using Gecko web driver from Selenium 3.0. Please click here for more info.

    We need to update ‘webdriver-manager’ to run protractor tests on FF48 or greater.

    webdriver-manager update

    The above command will download ‘Gecko’ driver.

    Execute the below command in Command Prompt/Terminal to make use of ‘Gecko’ driver.

    webdriver-manager » Continue Reading.

    Setting Logging preferences in protractor: loggingPrefs

    Protractor

    There are different loggers and their log levels in protractor. Click here to read about loggers.

    We can configure the logging levels in protraction configuration file.

    capabilities: { 'browserName': 'chrome', 'loggingPrefs': { 'driver': 'WARNING', 'server': 'WARNING', 'browser': 'INFO' } }

    Execute the below spec to capture the console log.

    describe('Capture Console messages', function() { beforeEach(function() { browser.get('http://angularjs.org/') }); » Continue Reading.

    Loggers and logging levels in protractor

    Protractor

    There are three different loggers in protractor.

    • Driver
    • Server
    • Browser

    Driver logger:Driver logger is to capture the messages logged at driver level(Logged by the webdriver). Server logger: Server logger is to capture the messages logged at selenium server console. Browser logger: Browser logger is to capture the messages logged in the Browser console.

    The logging levels available in » Continue Reading.

    Identifying Javascript errors in a webpage using Protractor

    Protractor

    Javascript errors are very common in any web application. It is possible that the Javascript errors may skip through testers eye. So, it would be better if an automation tool identify them well before they cause any problems in production.

    As Protractor was implemented using JavaScript, we can easily capture the Javascript errors from the browser’s console.

    Use the below » Continue Reading.