I have the following code snippet and it works in its context.
"use strict"; require('chromedriver'); var selenium = require('selenium-webdriver'); var driver = new selenium.Builder() .forBrowser('chrome') .build();
What I do not understand is the line:
require('chromedriver');
If I delete it, I get an error message:
Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
And so it does.
I understand what var chromedriver = require('chromedriver'); , and I only saw that the require function is still used.
So my questions regarding the string are: require('chromedriver');
Why does it work?
Where is the required chrome recorder located?
What happens in genereal if the require () function does not save its return to a variable?
source share