How to perform JavaScript Execution from Test Recorder?

Now, QAS supports JavaScript custom steps for Test cases recorded using the Test Recorder. Follow the mentioned steps to see the examples below:

  • Record a Test Case in a sample website, for example, https://www.seleniumeasy.com/test/javascript-alert-box-demo.html.

  • On the recorded steps you would require to insert the following sample JavaScript commands based on your testing scenarios:

    • Execute Java Script: This command executes the JavaScript that is manually provided in the ‘Input’ field.

    • Execute Async Java Script: This command waits for the Java Scripts to get executed for a duration of time (milliseconds) provided by users.

  • Below is an example for one of the scenarios where users want to scroll down the webpage to verify the text:

 

  • In the recorded step, users need to manually add the Java Scripts for scrolling down the page in the JS Editor as showcased in the below screenshot:

    • Go to Execute Java Script step and click on the 'input' panel.

    • After clicking on the 'Input' panel the JS Editor will appear.

    • Write the Java script in the JS editor and click on ‘Save’.