Skip to content

Instantly share code, notes, and snippets.

@trungpv1601
Last active February 16, 2019 08:16
Show Gist options
  • Save trungpv1601/d60e49832163b70f9aef9263bef16053 to your computer and use it in GitHub Desktop.
Save trungpv1601/d60e49832163b70f9aef9263bef16053 to your computer and use it in GitHub Desktop.
Docker Command

Redis

docker run --name my-redis -p 6379:6379 --restart always --detach redis --requirepass <password>

Selenium

docker run -d --name selenium-hub -p 4444:4444 --restart always selenium/hub

docker run -d -P --link selenium-hub:hub --restart always selenium/node-chrome
  • Example
npm install selenium-webdriver -S
const {Builder, until} = require('selenium-webdriver');
let driver = new Builder()
    .forBrowser('chrome')
    .usingServer(process.env.SELENIUM_REMOTE_URL || 'http://localhost:4444/wd/hub')
    .build();

    const url = "https://www.spreadshirt.com/mom";

    driver.get(url)
    .then(() => driver.getTitle())
    .then((title) => {
        console.log(title);
    })
    .then(() => {
        driver.quit();
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment