| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const webdriverio = require('webdriverio');
- const chromedriver = require('chromedriver');
- // todo: stop works only with 9515
- const port = 9515;
- const args = [
- // '--url-base=/wd/hub',
- `--port=${port}`
- ];
- console.log(args);
- console.log('start chromedriver');
- chromedriver.start(args);
- console.log('after start')
- const options = {
- port,
- path: '/',
- desiredCapabilities: {
- port,
- browserName: 'chrome',
- },
- };
- webdriverio
- .remote(options)
- .init()
- .on('error', (e) => console.error(e))
- .once('end', () => {
- console.log('end');
- process.nextTick(function () {
- console.log('stopping');
- chromedriver.stop();
- });
- })
- .url('https://www.google.com')
- .getTitle().then(function (title) {
- console.log('Title was: ' + title);
- }).catch(console.log)
- .end();
|