[Tutorial] Parameterized Test With Mocha | Selenium WebDriver With JavaScript Tutorial ▶️

Learn how to parameterize the Mocha Selenium Webdriver test in JavaScript and how it can be used to realize JavaScript testing.

This video is part IX of the Selenium WebDriver JavaScript Tutorial series. In this video, Ryan Howard (@ryantestsstuff) covers what is a parameterized test and how to use Mocha in JavaScript to parameterize the test. This video will also cover the basics of Selenium WebDriver, where he showcases how to leverage parameterization to perform web automation testing using JavaScript on multiple browser and platform (or OS) combinations.

You will also have insights on how to perform cross browser testing using Mocha in JavaScript at scale on LambdaTest’s cloud Selenium Grid to enhance your testing experience.

Also Learn :ticket: -:

:small_orange_diamond: What is Mocha testing?

:small_orange_diamond: Does Mocha use selenium?

:small_orange_diamond: How to use Mocha to parameterize the test?

:small_orange_diamond: Does Mocha run tests in parallel?


Parameterized test don’t seem to work when you’re generating dynamic data to iterate over. For example if I hard code the dataArray like this:

let dataArray = [
    { jobID: "DUMMY"},
    { jobID: "CLW01"},

then when i do dataArray.forEach(({jobID})) => {… this works fine

however, if i generate dataArray by reading in contents from a file and then i try to do the forEach on dataArray the it block does not run. There is also no error. Nothing happens basically.

Does parameterization work with objects that are created dynamically?