Giter Club home page Giter Club logo

phantom-wd's Introduction

phantom-wd

A webdriver (using wd) wrapper around PhantomJS.

PhantomJS must be installed and available on the PATH for this package to work.

Usage

var phantom = require("phantom-wd");

var browserPromise = phantom({
    debug: false       // boolean, console.log PhantomJS output
    port:  8910        // number, which port PhantomJS should listen on
});

browserPromise is a promise for wd.promiseRemote.

phantom()
.then(function (browser) {
    return browser.get("http://admc.io/wd/test-pages/guinea-pig.html")
    .then(function () {
        return browser.execute("return document.title");
    })
    .then(function (title) {
        expect(title).toEqual("WD Tests");

        // This both shuts down the webdriver connection and kills PhantomJS
        return browser.quit();
    });
})
.done();

License

BSD 2-Clause

phantom-wd's People

Contributors

hthetiot avatar stuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

phantom-wd's Issues

Error generated stating Timeout waiting for PhantomJS to start

When i copy the example and execute I get the following error. I have installed Phantom JS and also set the path.

C:\slimerTest>node test2.js
[INFO - 2018-02-01T23:30:52.896Z] GhostDriver - Main - running on port 8910
[INFO - 2018-02-01T23:30:52.934Z] Session [f19c10f0-07a7-11e8-8540-a5aeb1ca7eec] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true}
[INFO - 2018-02-01T23:30:52.934Z] Session [f19c10f0-07a7-11e8-8540-a5aeb1ca7eec] - page.customHeaders: - {}
[INFO - 2018-02-01T23:30:52.934Z] Session [f19c10f0-07a7-11e8-8540-a5aeb1ca7eec] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"windows-10-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2018-02-01T23:30:52.934Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: f19c10f0-07a7-11e8-8540-a5aeb1ca7eec
C:\Users\kam\node_modules\phantom-wd\node_modules\q\q.js:155
throw e;
^

Error: Timeout waiting for PhantomJS to start
at null._onTimeout (C:\Users\kam\node_modules\phantom-wd\node_modules\q\q.js:1846:21)
at Timer.listOnTimeout (timers.js:92:15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.