Open joscha opened 7 years ago
The code is:
import assert from 'assert';
import cabbie, { startChromedriver } from 'cabbie-sync';
// Start the chromedriver server, this provides a local selenium server
// You must install chromedriver to use this.
startChromedriver();
// connect to chromedriver, adding {debug: true} makes cabbie log each method call.
const driver = cabbie('chromedriver', { debug: true });
try {
// navigate to a url in the currently active window
driver.browser.activeWindow.navigateTo('http://example.com');
// get an element, and check that its text equals some expected value
assert.equal(
driver.browser.activeWindow.getElement('h1').getText(),
'Example Domain',
);
} catch(e) {
console.log(e);
} finally {
// whether tests pass or fail, dispose of the driver
driver.dispose();
}
it works fine with taxi-rank
.
Yes, I think the chromedriver npm package may have stopped working reliably. I'm not sure what's causing this. I think the best way to resolve this might just be to download chromedriver separately (from https://chromedriver.storage.googleapis.com/index.html?path=2.29/) and then run it in a separate terminal, manually.
I keep on getting:
After googling, this is presumably a problem with the
startChromedriver
method. It happens both withcabbie-sync
andcabbie-async
.