forbeslindesay / cabbie Goto Github PK
View Code? Open in Web Editor NEWWebDriver for the masses
Home Page: https://cabbiejs.org/
License: MIT License
WebDriver for the masses
Home Page: https://cabbiejs.org/
License: MIT License
My code is -
var assert = require('C:/slimerTest/node_modules/assert');
var {startChromedriver} = require('C:/slimerTest/node_modules/cabbie-sync');
var cabbie = require ('C:/slimerTest/node_modules/cabbie');
// 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.activeWindow.navigateTo('http://example.com');
// get an element, and check that its text equals some expected value
assert.equal(
driver.activeWindow.getElement('h1').getText(),
'Example Domain',
);
} finally {
// whether tests pass or fail, dispose of the driver
//driver.dispose();
}
But im getting an error when i run through node command
const driver = cabbie('chromedriver', {debug: true});
^
TypeError: cabbie is not a function
why is this?
You wanted to spent some time to look through the code before releasing it. Any updates on that? Here at Yahoo, we are in the process of releasing some projects that have a dependency on the unreleased code, and we are currently using the git repository directly.
Please let me know what the plan is.
Just wanted to let you know that I've integrated cabbie into a project called kommando today (uxebu/kommando@ecf44a0) and cabbie makes writing / reading selenium tests much easier than any other (async) webdriver libraries I've used before. You can find the same selenium tests written with different webdriver libraries here.
kommando is meant to take over the tedious task to download / launch / configure the various webdriver servers that are out there and executing selenium tests against those servers with a test framework you prefer to use.
I see a lot of potential that both projects could benefit from each other and I currently have the following questions:
If you would like to play with cabbie within kommando you can use the following test:
// cabbie-kommando-example.js
var assert = require('assert');
module.exports = function(callback) {
var browser = kommando.browser;
browser.navigateTo('https://github.com');
assert.equal(
browser.getElement('.heading').text(),
'Build software better, together.'
);
console.log('Found heading');
callback();
};
and execute that test using kommando (installable via npm install kommando
):
# execute test against phantomjs
kommando --client cabbie --runner plain cabbie-kommando-example.js
# execute test against chrome, firefox and phantomjs
kommando --browser chrome --browser firefox --browser phantomjs \
--client cabbie --runner plain cabbie-kommando-example.js
# execute test against chrome using chromedriver
kommando --browser chrome --driver chromedriver --client cabbie \
--runner plain cabbie-kommando-example.js
Cabbie does not seem to work with the local url configuration of broweser stack.
Is there some special option or cofiguration that could be passed to cabbie ?
Sauce Labs:
Invalid request (404):
ERROR The test with session id eea669797cfa493aa923ad4d574bfd79 has already finished, and can't receive further commands.
You can learn more at https://saucelabs.com/jobs/eea669797cfa493aa923ad4d574bfd79
For help, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages (while navigating to url)
I keep on getting:
Error: connect ECONNREFUSED 127.0.0.1:9515
at doRequestWith (/Users/joscha/Development/canva/web/node_modules/sync-request/index.js:87:11)
at doRequest (/Users/joscha/Development/canva/web/node_modules/sync-request/index.js:20:10)
at Connection.request (/Users/joscha/Development/canva/web/node_modules/cabbie-sync/lib/connection.js:154:52)
at createSession (/Users/joscha/Development/canva/web/node_modules/cabbie-sync/lib/driver.js:385:24)
at Driver (/Users/joscha/Development/canva/web/node_modules/cabbie-sync/lib/driver.js:201:20)
at createCabbieDriver (/Users/joscha/Development/canva/web/node_modules/cabbie-sync/lib/index.js:221:29)
at Object.<anonymous> (/Users/joscha/Development/canva/web/src/pages/editor/happy-path.js:9:16)
at Module._compile (module.js:571:32)
at loader (/Users/joscha/Development/canva/web/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/joscha/Development/canva/web/node_modules/babel-register/lib/node.js:154:7)
After googling, this is presumably a problem with the startChromedriver
method.
It happens both with cabbie-sync
and cabbie-async
.
If I understand correctly, the proper way to fill form is element.sendKeys().
However on password field I run into an issue.
Some kind of password autofill menu appears and keys get lost. (Ie only two of five characters are typed)
First using element.click() on the input mitigate the issue for me.
Using taxi-rank and cabbie-sync to fetch the "checked" property of an un-checked checkbox, produces the error:
"Return Type must be a string"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.