September 2018
Intermediate to advanced
764 pages
20h 6m
English
The biggest benefit of using Selenium is that you can use the same tests to test multiple browsers. If we are interested in just a single browser, like Chrome, we'd be better off using Puppeteer. So, let's add Firefox to our tests.
Firefox, like Chrome, requires a driver to work. Firefox's driver is geckodriver, which uses the Marionette proxy to send instructions to Firefox (Marionette is similar to Chrome's DevTools Protocol):
$ yarn add geckodriver --dev
Now, all we need to do is change the forBrowser call to use "firefox":
this.driver = new webdriver.Builder() .forBrowser("firefox") .build();
When we run our tests again, Firefox will be used instead of Chrome.
However, instead of hard-coding the browser ...
Read now
Unlock full access