Sunday, December 16Be an Automation Engineer

JavaScript

Protractor with jasmine data provider – Write once test many times

Protractor with jasmine data provider – Write once test many times

Jasmine, JavaScript, Protractor
What is data provider?

When it comes to automation, data provider is an approach to pass test data to the automation tests. Each and every automation tool has it’s own way of providing test data to the automation When we take TestNG framework, it has @DataProvider annotation which will help to pass test data to the automation test.

Why we » Continue Reading.

Execute Asynchronous Javascript in protractor

JavaScript, Javascript Executor, Protractor

Protractor has two functions to execute javascript code in tests.

  • executeScript
  • executeAsyncScript
  • We’ve explained about executeScript with examples here.

    Now, Lets know about executeAsyncScript.

    browser.executeAsyncScript(Asnynchronousjavascript, args…)

    Basically protractor provided this method to execute any asynchronous javascript code. We need to use this method to execute a javascript which has ajax calls or timeouts in it.

    executeAsyncScript takes one » Continue Reading.

    Javascript Executor in protractor

    JavaScript, Javascript Executor, JS, Promise, Protractor

    Most of the time we interact with web elements using selenium internal methods like click, sendKeys, select etc..

    Why we need javascript executor? Selenium is written in the way that it should not interact hidden elements on the webpage. Real user can not interact with the hidden elements in the web page so selenium guys are also not allowing » Continue Reading.
    Find elements using javascript in protractor

    Find elements using javascript in protractor

    JavaScript, JS, Protractor

    There are many element location strategies available in protractor. Click here to know about element locators in protractor.

    by.js is one more element locating strategy available in protractor. We need to pass javascript code as a string or as a function to by.js to get single/multiple element(s).

    Pass javascript code as a string:

    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.

    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 –