Friday, July 19Be an Automation Engineer

Author: Vijay

Installing node.js and npm on MAC

Installation

Node Js can be installed from brew Or we can download and install manually.

1. Installing node through brew:

First we need to install homebrew in MAC

  • Please execute the below command in terminal to install brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Close the terminal and open it again
  • Run brew update to update brew » Continue Reading.

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.