Thursday, October 29Be an Automation Engineer

Tag: Javascript Executor

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.