Home > Automation Testing > Protractor

Protractor: Script execution using custom command

This article will cover below points:  Use of custom command instead of protractor along with user defined options to control the execution of script. Protractor script execution for different test suites using different configuration files i.e. In regression test suite we will execute all spec files In smoke test suite we execute

This Article is TAGGED in , , , , , , . Read more

Finding elements of table in selenium

Elements in table can be accessed using xpath. Here is the sample HTML code: [crayon-62ba1e9d1c632496107270/] To locate first “td” in first “tr” in above HTML code. Below is the xpath:   //table//tr[1]/td[1] To locate second “td” in first “tr”. Below is the xpath. //table//tr[1]/td[2] To locate cells of Pune and Mumbai below is the xpath. //table//tr[1]/td To locate the

This Article is TAGGED in , . Read more

Software Automation Test Life Cycle

Automation Test life cycle go through 7 phases mentioned below. Defining the automation scope Selecting the right tool for automation Automation Framework Design Setting up environment Test script development Test script execution and report generation Test script maintenance Defining the automation scope: In this phase it is necessary to check the Feasibility, Scope, Team size and Productivity of automation

This Article is TAGGED in . Read more

Protractor Tutorial

Protractor is a Node.js program which is used for testing of Angular JS applications. It is combination of Selenium, Jasmine, Webdriver etc. Along with Angular JS applications protractor can also be used in testing of normal web applications. Installation of Protractor: Protractor installation and configuration Advantages and disadvantages of protractor Locators and Sample

This Article is TAGGED in , . Read more

Use Actions class to perform keyboard event in selenium

Code to perform key press events , mouse left right operations using action class. Functions for keyboard Uses keyDown(java.lang.CharSequence key) To simulate key down event on current location. keyDown(WebElement target, java.lang.CharSequence key) To simulate key down event on target element. keyUp(java.lang.CharSequence key) To simulate key up event on current location. keyUp(WebElement target, java.lang.CharSequence key) To simulate key up event on

This Article is TAGGED in . Read more

Code to perform Image comparison in protractor

To perform image comparison in GUI Testing we need to install protractor-image-comparison module it can be installed using below command. Open command prompt and run below command. [crayon-62ba1e9d1cd00957702905/] Add below code in onPrepare function of configuration file [crayon-62ba1e9d1cd07024319526/] Code to do image comparison [crayon-62ba1e9d1cd0a071846520/] ImageName is image file name exist in baseline folder. If image is not

This Article is TAGGED in , . Read more

Simple protractor script

Code for sample protractor script: In protractor there are two basic files to execute any automation script. Those are configuration file and specification file. Configuration file contains all configuration related code. And specification file contains test scripts. Configuration file is one for the project and we can have any number

This Article is TAGGED in . Read more

How to install protractor and configure?

To configure protractor below are the steps: 1. Download eclipse from https://www.eclipse.org/downloads/ and install it. 2. Download node.js from https://nodejs.org/en/download/ and install it. 3. Open the command prompt and run below command. It will install protractor globally. “npm install -g protractor”. 4. Run below command in protractor to update webdriver. “webdriver-manager update“. 5. Start the selenium server by running

This Article is TAGGED in . Read more

Handling Popups using protractor

Identify or handle javascript popup/alert using protractor in automation. Javascript popup cannot be inspected. We don't get html for javascript popup. So we cannot find element and it is not possible to perform operation based on web element. There are different types of java script popups. Those are Simple alert, Confirmation

This Article is TAGGED in , , . Read more

Protractor: Add data in excel sheet using exceljs in node

Prerequisite:To perform write operation on excel sheet we need node application and exceljs library installed. Below is the code for different write action on excel file. Add sheet to new excel file [crayon-62ba1e9d1d744220176318/]   Add row in new sheet [crayon-62ba1e9d1d749831260624/]   Edit Existing Excel File [crayon-62ba1e9d1d74c143688613/]  

This Article is TAGGED in , , , , . Read more