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?
EDIT
I've added https://github.com/hamitaksln/heroku-integrated-firefox-geckodriver as a build pack
and set configuration vars as such:
FIREFOX_BIN=/app/vendor/firefox/firefox
GECKODRIVER_PATH=/app/vendor/geckodriver/geckodriver
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/app/vendor
PATH=/usr/local/bin:/usr/bin:/bin:/app/vendor/
but it still shows an ERROR of incorrect path to geckodriver