Giter Club home page Giter Club logo

q-wd's Introduction

q-wd.js - A light weight WebDriver/Se2 client for node.js

admc/q adapted to use promises from Q

Authors

Usage

var webdriver = require("q-wd")

var browser = webdriver.remote();
browser.init({browserName:"firefox"}).then(function() {
  return browser.get("http://www.jelly.io");
}).then(function() {
  return browser.eval("window.location.href");
}).then(function(o) {
  console.log(o);
  return browser.get("http://www.seleniumhq.org");
}).then(function() {
  return browser.quit();
}).then(function() {
  console.log("DONE");
});

Supported Methods

  - 'close': Close the browser
  - 'quit': Quit the session
  - 'eval': Eval JS and return the value (takes a code string)
  - 'execute': Eval JS (takes a code string)
  - 'executeAsync': Execute JS in an async way (takes a code string)
  - 'get': Navigate the browser to the provided url (takes a URL)
  - 'setWaitTimeout': Set the implicit wait timeout in milliseonds (takes wait time in ms)
  - 'element': Access an element in the page (takes 'using' and 'value' so ex: 'id', 'idofelement')
  - 'moveTo': Move an element on the page (takes element, xoffset and yoffset'
  - 'scroll': Scroll on an element (takes element, xoffset, yoffset)
  - 'buttonDown': Click and hold the left mouse button down, at the coords of the last moveTo
  - 'buttonUp': Release the left mouse button
  - 'click': Click a mouse button, at the coords of the last moveTo (takes a button param for {LEFT = 0, MIDDLE = 1 , RIGHT = 2})
  - 'doubleClick': Double click a mouse button, same coords as click
  - 'type': Type! (takes an element, a key character, or an array of char keys)
  - 'active': Get the element on the page currently with focus
  - 'keyToggle': Press a keyboard key (takes an element and a key character'

More docs!

WD is simply implementing the Selenium JsonWireProtocol, for more details see the official docs: http://code.google.com/p/selenium/wiki/JsonWireProtocol

q-wd's People

Contributors

admc avatar aflatter avatar epall avatar hugs avatar peterbraden avatar stuk avatar

Watchers

 avatar  avatar  avatar

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.