We should have a little bit javascript knowledge.
Now, Let’s write our first test script. In this first test script, We will only see, How can we launch a Browser and How can we navigate to our applicate in the browser using Selenium with Javascript.
const {Builder, Browser} = require('selenium-webdriver');
(async function example() {
//launch the browser
let driver = await new Builder().forBrowser(Browser.FIREFOX).build();
//navigate to the application
await driver.get('https://www.google.com/ncr');
//close the browser
await driver.quit();
})();
const { Builder, Browser } = require("selenium-webdriver");
(async function example1() {
//launch the browser
let driver = await new Builder().forBrowser(Browser.FIREFOX).build();
//navigate to the application
await driver.get("https://qpdemoecommerce.com");
//close the browser
await driver.quit();
})();
We have covered below topics in today’s session
Why we can not over ride a Constructor This is a very important question, that,…
What is Arrow Function In the last session, We had discussed about Anonymous Function. Anonymous…
What is Anonymous Function Anonymous Function is a type of function which has no name…
What is Map, Reduce and Filter Map Filter and Reduce are higher order methods for…
9 different ways of declaring or defining a function in Javascript In, one of our…
Loops with Arrays in Javascript In our last session, we had seen, What is Array…