How to setup Selenium on Heroku for Firefox?

I’ve made a node.js script like this:

const { Builder, By, Key, until } = require('selenium-webdriver');

const driver = new Builder().forBrowser("firefox").build();

const search_query = 'tigers';

(async () => {
    await driver.get(`https://www.google.com/search?q=${search_query}`);

    const h3Elements = await driver.findElements(By.css('h3'));
    for (const h3 of h3Elements) {
        console.log(await h3.getText());
    }

    console.log('...Task Complete!')
})();

and now I want to test it on a heroku server

but sadly I have no experience or understanding when it comes to setup

I tried following these link:
How to use Selenium Webdriver on Heroku?
How to run Selenium-Webdriver on Heroku with node.js (Firefox or Chrome)

but neither are for firefox
so how do I launch the above script on a heroku server? and what exactly is the process that is going on when it comes to web drivers on the server?

Source: Ask Javascript Questions

LEAVE A COMMENT