Giter Site home page Giter Site logo

webdriverio / webdriverio Goto Github PK

View Code? Open in Web Editor NEW
8.7K 218.0 2.4K 319.21 MB

Next-gen browser and mobile automation test framework for Node.js

Home Page: http://webdriver.io

License: MIT License

JavaScript 3.64% TypeScript 93.78% Gherkin 0.06% CSS 0.78% EJS 1.69% Dockerfile 0.04% Svelte 0.01% Vue 0.01%
javascript webdriverio webdriver node test automation devtools performance performance-test mocha

webdriverio's Introduction

Stand With Ukraine

WebdriverIO

Next-gen browser and mobile automation test framework for Node.js.

Build Status Package Health OpenSSF Best Practices
Support Channel Issue Resolution time Open issues


Homepage | Developer Guide | API Reference | Contribute | Changelog | Roadmap


WebdriverIO is a test automation framework, for e2e as well as unit and component testing in the browser, that allows you to run tests based on the WebDriver and WebDriver BiDi as well as Appium automation technology. It provides support for your favorite BDD/TDD test framework and will run your tests locally or in the cloud using Sauce Labs, BrowserStack, TestingBot or LambdaTest.

๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ‘จโ€๐Ÿ’ป Contributing

Do you like WebdriverIO and want to help make it better? Awesome! Have a look into our Contributor Documentation to get started and find out what contributions can be and how to make them.

Getting started with GitHub Codespaces

To get started, create a codespace for this repository by clicking this ๐Ÿ‘‡

Open in GitHub Codespaces

A codespace will open in a web-based version of Visual Studio Code. The dev container is fully configured with the software needed for this project.

Note: Dev containers are an open spec that is supported by GitHub Codespaces and other tools.

Getting started with Gitpod

You can also just click on:

Open in Gitpod

to get a ready-to-use development environment for you to start working on this code base.

If you're looking for issues to help out with, check out the issues labeled "good first pick". You can also reach out to our Matrix Channel if you have questions on where to start contributing.

๐Ÿข WebdriverIO for Enterprise

Available as part of the Tidelift Subscription.

The maintainers of WebdriverIO and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open-source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

๐Ÿ“ฆ Packages

This repository contains some of the core packages of the WebdriverIO project. There are many wonderful curated resources the WebdriverIO community has put together.

Did you build a WebdriverIO service or reporter? That's awesome! Please add it to our configuration wizard and docs (e.g. like in this example commit) as well as to our awesome-webdriverio list. Thank you! ๐Ÿ™ โค๏ธ

Core

  • webdriver - A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol
  • webdriverio - Next-gen browser and mobile automation test framework for Node.js
  • @wdio/cli - A WebdriverIO testrunner command line interface

Helper

  • @wdio/config - A helper utility to parse and validate WebdriverIO options
  • @wdio/logger - A helper utility for logging WebdriverIO packages
  • @wdio/protocols - Utility package providing information about automation protocols
  • @wdio/repl - A WDIO helper utility to provide a repl interface for WebdriverIO
  • @wdio/reporter - A WebdriverIO utility to help report all events
  • @wdio/runner - A WebdriverIO service that runs tests in arbitrary environments
  • @wdio/utils - A WDIO helper utility to provide several utility functions used across the project
  • @wdio/globals - A WDIO helper utility for importing global variables directly

Reporter

Services

  • @wdio/appium-service - A WebdriverIO service to start & stop Appium Server
  • @wdio/browserstack-service - A WebdriverIO service that can be used to use BrowserStack Test Observability which is a reporting, debugging, and test suite quality tracking tool for any test running anywhere. The service also helps for a better integration with the BrowserStack grid if you're running tests on the grid.
  • @wdio/devtools-service - A WebdriverIO service that allows you to run Chrome DevTools commands in your tests
  • @wdio/firefox-profile-service - A WebdriverIO service that lets you define your Firefox profile in your wdio.conf.js
  • @wdio/sauce-service - A WebdriverIO service that provides a better integration into Sauce Labs
  • @wdio/shared-store-service - A WebdriverIO service to exchange data across processes
  • @wdio/testingbot-service - A WebdriverIO service that provides a better integration into TestingBot

Runner

Framework Adapters

Others

๐Ÿค Project Governance

This project is maintained by awesome people following a common set of rules and treating each other with respect and appreciation.

๐Ÿ‘จโ€๐Ÿณ ๐Ÿ‘ฉโ€๐Ÿณ Backers

Become a backer and show your support for our open-source project.

๐Ÿ’ธ Sponsors

Does your company use WebdriverIO? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time to maintenance and new features for everyone. Also, your company's logo will show on GitHub - who doesn't want a little extra exposure? Here's the info.

๐Ÿ’Ž Premium Sponsor

We are immensely grateful to our exclusive Premium Sponsor for their invaluable support in the development of this project:

BrowserStack ย  ย  ย  Sauce Labs

๐Ÿฅˆ Silver Sponsor

Lambdatest

๐Ÿฅ‰ Bronze Sponsor

Eslint

๐Ÿ“„ License

MIT

FOSSA Status

๐Ÿ”ฐ Badge

Show the world you're using webdriver.io โ†’ tested with webdriverio

GitHub markup
[![tested with webdriver.io](https://img.shields.io/badge/tested%20with-webdriver.io-%23ea5906)](https://webdriver.io/)
HTML
<a href="https://webdriver.io/">
    <img alt="WebdriverIO" src="https://img.shields.io/badge/tested%20with-webdriver.io-%23ea5906">
</a>

๐Ÿ‘ Supporters

Stargazers repo roster for WebdriverIO Forkers repo roster for WebdriverIO

Animated footer bars


Back to top

webdriverio's People

Contributors

abjerstedt avatar ablok avatar andriilazebnyi avatar ankit098 avatar baruchvlz avatar borisosipov avatar christian-bromann avatar crispusdh avatar dependabot-preview[bot] avatar dependabot[bot] avatar erwinheitzman avatar fijijavis avatar greenkeeper[bot] avatar harsha509 avatar jan-molak avatar jlipps avatar klamping avatar lacell75 avatar marketionist avatar mgrybyk avatar nextlevelbeard avatar pako88 avatar praveendvd avatar scg82 avatar sriteja777 avatar tamil777selvan avatar unickq avatar wdio-bot avatar willbrock avatar wswebcreation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webdriverio's Issues

Error passing phantomjs.cli.args in capabilities

I'm not quite sure if this is the right place to report this issue or ghostdriver, if not please point to right direction.

desiredCapabilities: { browserName: 'phantomjs', "phantomjs.cli.args" : ["--ignore-ssl-errors=yes"] },

Passing phantomjs.cli.args causes runtime error on selenium.

Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Ljava.lang.String; at org.openqa.selenium.phantomjs.PhantomJSDriverService.findCommandLineArguments(PhantomJSDriverService.java:276) at org.openqa.selenium.phantomjs.PhantomJSDriverService.createDefaultService(PhantomJSDriverService.java:158) at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:85) ... 14 more

looking at ghostdriver source code, usingCommandLineArguments function expect String[], but it seams actual parameter is in form of List<String>.

How to add command without callback?

The current example for using addCommand expects a callback. Is it possible to add a command that dosen't expect a call back something similiar to a setValue

An error in a test seems to block my ability to end() the client

https://gist.github.com/bingomanatee/4954746

Show my test suite, in mocha.

the fact that the client nested call is not completing (as mocha is throwing errors)

seems to pre-empt the ability of end() to terminate the selenium connection.

Given that this is the accepted pattern of testing -- failed acceptance test throwing errors -- this seems like a fairly common scenario; is there any other way to get end() to work despite pending functions?

Dave

Failed with chrome

var client = webdriverjs.remote({
host: "localhost",
port: 9001,
desiredCapabilities:{browserName: "chrome"}
});

If I change to firefox or remove the desiredCapabilities line, it works fine. I have a chrome installed on OSX 10.6.

[10:28:05]: COMMAND POST "/wd/hub/session"
[10:28:05]: DATA {"desiredCapabilities":{"browserName":"chrome","version":"","javascriptEnabled":true,"platform":"ANY"},"sessionId":null}
[10:28:05]: COULDNT GET A SESSION ID
[10:28:05]: ERROR UnknownError An unknown server-side error occurred while processing the command.
[10:28:05]: {"sessionId":"","status":13,"value":{"message":"The path to the chromedriver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromium/downloads/list","localizedMessage":"The path to the chromedriver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromium/downloads/list","cause":null,"class":"java.lang.IllegalStateException","hCode":1700675012,"stackTrace":[{"fileName":"Preconditions.java","class":"java.lang.StackTraceElement","lineNumber":172,"className":"com.google.common.base.Preconditions","nativeMethod":false,"methodName":"checkState","hCode":-1301733689},{"fileName":"ChromeDriverService.java","class":"java.lang.StackTraceElement","lineNumber":85

webdriverjs + phantomjs + selenium-server >= 2.34: "COULDNT GET A SESSION ID"

So here's my repro:

  1. Put this into repro.js:
    var client = require('webdriverjs').remote({ desiredCapabilities: { browserName: 'phantomjs' } });
    client.init().url('http://google.com')
    .getTitle(function(err, title)
    {
    console.log(err, title);
    }).end();
  2. java -jar selenium-server-standalone-2.34.0.jar
  3. node repro.js

Expect: Works.
Actual:

[19:44:06]:  COMMAND    POST     "/wd/hub/session"
[19:44:06]:  DATA                {"desiredCapabilities":{"browserName":"phantomjs","version":"","javascriptEnabled":true,"platform":"ANY"},"sessionId":null}
[19:44:07]:  ERROR      COULDNT GET A SESSION ID
[19:44:07]:  RESULT              {"platform":"LINUX","acceptSslCerts":false,"javascriptEnabled":true,"browserName":"phantomjs","rotatable":false,"driverVersion":"1.0.3","locationContextEnabled":false,"webdriver.remote.sessionid":"77123753-c6fe-43f7-9386-c8e34b787efd","version":"1.9.1","databaseEnabled":false,"cssSelectorsEnabled":true,"handlesAlerts":false,"browserConnectionEnabled":false,"nativeEvents":true,"webStorageEnabled":false,"proxy":{"proxyType":"direct"},"applicationCacheEnabled":false,"driverName":"ghostdriver","takesScreenshot":true}
[19:44:07]:  ERROR      NO SESSION, EXITING
[19:44:07]:  COMMAND    POST     "/wd/hub/session/:sessionId/url"
[19:44:07]:  DATA                {"url":"http://google.com"}
[19:44:07]:  COMMAND    GET      "/wd/hub/session/:sessionId/title"
[19:44:07]:  ERROR      COULDNT GET A SESSION ID
null undefined
[19:44:07]:  COMMAND    DELETE   "/wd/hub/session/:sessionId"
[19:44:07]:  ERROR      COULDNT GET A SESSION ID
[19:44:07]:  ERROR      COULDNT GET A SESSION ID

Then try it with selenium-server-standalone-2.33.0.jar. Then it works.

Here's a trace from selenium-server-standalone 2.34:

Aug 26, 2013 7:44:56 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
19:44:56.455 INFO - Java: Sun Microsystems Inc. 20.0-b12
19:44:56.455 INFO - OS: Linux 3.8.13-gentoo amd64
19:44:56.466 INFO - v2.34.0, with Core v2.34.0. Built from revision 11cd0ef
19:44:56.532 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
19:44:56.533 INFO - Version Jetty/5.1.x
19:44:56.533 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
19:44:56.534 INFO - Started HttpContext[/selenium-server,/selenium-server]
19:44:56.534 INFO - Started HttpContext[/,/]
19:44:56.546 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@2df6df4c
19:44:56.546 INFO - Started HttpContext[/wd,/wd]
19:44:56.549 INFO - Started SocketListener on 0.0.0.0:4444
19:44:56.549 INFO - Started org.openqa.jetty.jetty.Server@32c8f6f8
19:44:59.877 INFO - Executing: [new session: {platform=ANY, javascriptEnabled=true, browserName=phantomjs, version=}] at URL: /session)
19:44:59.884 INFO - Creating a new session for Capabilities [{platform=ANY, javascriptEnabled=true, browserName=phantomjs, version=}]
19:44:59.895 INFO - executable: /home/ferrari/node_modules/.bin/phantomjs
19:44:59.895 INFO - port: 30586
19:44:59.895 INFO - arguments: [--webdriver=30586, --webdriver-logfile=/home/ferrari/code/frontend/ui-tests/phantomjsdriver.log]
19:44:59.895 INFO - environment: {}
PhantomJS is launching GhostDriver...
[INFO  - 2013-08-27T02:45:00.120Z] GhostDriver - Main - running on port 30586
[INFO  - 2013-08-27T02:45:00.611Z] Session [aaf7d5e0-0ec2-11e3-9c86-c599044757a8] - CONSTRUCTOR - Desired Capabilities: {"platform":"ANY","javascriptEnabled":true,"browserName":"phantomjs","version":""}
[INFO  - 2013-08-27T02:45:00.611Z] Session [aaf7d5e0-0ec2-11e3-9c86-c599044757a8] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.1","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"linux-unknown-64bit","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  - 2013-08-27T02:45:00.611Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: aaf7d5e0-0ec2-11e3-9c86-c599044757a8
19:45:00.648 INFO - Done: /session

I also thought it odd that getTitle passes 'undefined' as the error to the callback, when clearly there has been one :)

mouse up/down support?

Hi ,
Couldn't find any support for Mouse events (except for click).
It would be neat to have mouseup/down/move support.

Version bump and npm publish?

Similar to a previous request for this a long time ago. Not sure if this is the best way to request this, but could you bump the version of your npm package and do an npm publish? I'm using your awesome package for some UI automation tests via mocha, and would like to take advantage of some of your latest bug fixes and improvements.

Thanks!

webdriverjs client hangs on failed test

When running the webdriverjs, mocha, chai example:
https://github.com/camme/webdriverjs/blob/master/examples/webdriverjs.with.mocha.and.chai.js

If one of the assertions fails, the test hangs and does not proceed to the next test. For example, change line 24 to check for a incorrect size (also reduce the timeout at line 11 to something like 20000).

$ mocha test.js


=====================================================================================

Selenium 2.0/webdriver protocol bindings implementation with helper commands in nodejs by Camilo Tapia.
For a complete list of commands, visit http://code.google.com/p/selenium/wiki/JsonWireProtocol.
Not all commands are implemented yet. visit https://github.com/Camme/webdriverjs for more info on webdriverjs.

=====================================================================================

[10:51:28]:  COMMAND    POST     "/wd/hub/session"
[10:51:28]:  DATA        {"desiredCapabilities":{"browserName":"phantomjs","version":"","javascriptEnabled":true,"platform":"ANY"},"sessionId":null}
[10:51:30]:  SET SESSION ID 899bcbf1-143a-46ef-a5db-3cd43bb82755
[10:51:30]:  COMMAND    POST     "/wd/hub/session/899bcbf1-143a-46ef-a5db-3cd43bb82755/url"
[10:51:30]:  DATA        {"url":"https://github.com/"}
[10:51:40]:  COMMAND    POST     "/wd/hub/session/899bcbf1-143a-46ef-a5db-3cd43bb82755/element"
[10:51:40]:  DATA        {"using":"css selector","value":".header-logo-wordmark"}
[10:51:40]:  RESULT      {"ELEMENT":"0"}
[10:51:40]:  COMMAND    GET      "/wd/hub/session/899bcbf1-143a-46ef-a5db-3cd43bb82755/element/0/size"
[10:51:40]:  RESULT      {"height":30,"width":94,"class":"org.openqa.selenium.Dimension","hCode":96256}
โ€คโ€ค

  โœ– 2 of 1 test failed:

  1) my webdriverjs tests Github test:

      actual expected

      3000



  2) my webdriverjs tests "after all" hook:
     Error: timeout of 20000ms exceeded
      at null.<anonymous> (/usr/local/share/npm/lib/node_modules/mocha/lib/runnable.js:167:14)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

npm package versions in use:

It seems similar to this issue: http://stackoverflow.com/questions/13352860/node-js-mocha-webdriverjs-failed-tests-kill-suite
Which suggests WebDriverJS queue gets stalled when a test fails... Is there a suggested way to proceed when assert throws an error in this case?

Version bump and npm publish?

Could you bump the version of your npm package and do an npm publish? I have your package installed via npm and would like to be able to pick up the recent changes. I'd submit a pull request, but the code changes are pretty trivial...

Thanks!

LICENSE file

Hi Camilo,

Would it be possible for you to add a LICENSE file to repository
in the case your code is allowed to be used by others?

Unfortunately without clear license statement no one is allowed to use or copy it...

Thanks,
Denis

Maybe I don't understand how to use this api...

but all I'm trying todo is grab all the anchor elements on the page. The script runs and compiles but what I expect and what I get are two different things. Is this because the api isn't complete? Do I not know how to use this? I ended up debugging this with chrome and I'm gonna display my expected and actual inline...

Thanks in advance...
stringa

var webdriverjs = require("webdriverjs");
var client = webdriverjs.remote();

client.init();
client.url("file://localhost/Users/stringa/ddi/trunk/mobile/tests/qunit/test_index.html", function() {

client.elements('tag name', 'a', function (result) {

    // actual: result.value = [ {ELEMENT:0}, {ELEMENT:1} ]
    // expected: result.value = [ { ELEMENT;jsonStringOfData }, { ELEMENT;jsonStringOfData } ]
})

});

Help rquired by using the .click() method

Hi, i have trouble by using the webdriverjs.click(); method. i try to querry google pages, but everytime i try to correct the value inside i get a status 7 msg:

orgStatusMessage: 'An element could not be located on the page using the given search parameters.' }

could somebody please paste here some examples how to use .click() on google pages? for example search or advanced search?

I've trouble to locate the selectors - for example how to click this.

News

THX much for all responses

execute returning null causes error

If the execute() method returns null back from the browser, the following error occurs:

.../node_modules/webdriverjs/lib/webdriverjs.js:716
                    var value = result.value.length > 50 ? result.value.substring
                                         ^
TypeError: Cannot read property 'length' of null

This can be reproduced by running the following command as part of a test session.

execute("return null")

any way to get (& test in) the window scope?

Was wondering if there is any hack available to get the JS window object via the wire.

I would like to inspect & test for a global window.XY object properties & so far i found /session/:sessionId/execute
Update:

.execute('return window.VAR', callbackFunction)

Makes sense?

Sauce Labs support doesn't work

Hi!
I have tried this example here: https://gist.github.com/christian-bromann/6357801 with my credentials and it is not working :-(

The output of webdriverjs is following:

=====================================================================================

Selenium 2.0/webdriver protocol bindings implementation with helper commands in nodejs by Camilo Tapia.
For a complete list of commands, visit http://code.google.com/p/selenium/wiki/JsonWireProtocol.
Not all commands are implemented yet. visit https://github.com/Camme/webdriverjs for more info on webdriverjs.

=====================================================================================

[09:57:25]: COMMAND POST "/wd/hub/session"
[09:57:25]: DATA {"desiredCapabilities":{"browserName":"chrome","version":"27","javascriptEnabled":true,"platform":"XP","tags":["examples"],"name":"This is an example test"},"sessionId":null}
[09:58:29]: ERROR Error: connect ETIMEDOUT
[09:58:29]: COMMAND POST "/wd/hub/session/:sessionId/url"
[09:58:29]: DATA {"url":"http://google.com"}
[09:59:32]: ERROR Error: connect ETIMEDOUT
[09:59:32]: COMMAND POST "/wd/hub/session/:sessionId/element"
[09:59:32]: DATA {"using":"css selector","value":"[name="q"]"}
[10:00:35]: ERROR Error: connect ETIMEDOUT
[10:00:35]: COMMAND POST "/wd/hub/session/:sessionId/element"
[10:00:35]: DATA {"using":"css selector","value":"
[name="btnG"]"}
[10:01:39]: ERROR Error: connect ETIMEDOUT
[10:01:40]: COMMAND GET "/wd/hub/session/:sessionId/title"
[10:02:43]: ERROR Error: connect ETIMEDOUT
[10:02:43]: COMMAND DELETE "/wd/hub/session/:sessionId"
[10:03:47]: ERROR Error: connect ETIMEDOUT

Is there a possibility to get more log messages so I can debug what is the reason for "Error: connect ETIMEDOUT"???

Regards

getValue appears to be broken

if I have the html:

<p class="css-class">text</p>

then I try the following:

.getValue('.css-class', function(res){ console.log(res); })

then I get the result 'null'

but if I try

.getAttribute('.css-class', 'innerHTML', function(res){ console.log(res); })

then I get 'text'

is getValue broken or am I doing something wrong?

Not working with grid2 hub yet?

I ran the hub like this and registered several browsers from different nodes.
java -jar selenium-server-standalone-2.0rc1.jar -role hub -port 9000

The following failed.
var webdriverjs = require("webdriverjs");
var client = webdriverjs.remote({host: "localhost", port: 9000});
client.init().url("http://some.host.com/");

And here is the console output.
[13:36:20]: COMMAND POST "/wd/hub/session"
NO DESIRED ENV {"status":13,"value":{"message":"Error forwarding the new session cannot find : {platform=ANY, javascriptEnabled=true, browserName=firefox, version=}","class":"org.openqa.grid.internal.GridException","stackTrace":[{"fileName":"RequestHandler.java","lineNumber":143,"className":"org.openqa.grid.web.servlet.handler.RequestHandler","methodName":"process"},{"fileName":"DriverServlet.java","lineNumber":79,"className":"org.openqa.grid.web.servlet.DriverServlet","methodName":"process"},{"fileName":"DriverServlet.java","lineNumber":65,"className":"org.openqa.grid.web.servlet.DriverServlet","methodName":"doPost"},{"fileName":"HttpServlet.java","lineNumber":727,"className":"javax.servlet.http.HttpServlet","methodName":"service"},{"fileName":"HttpServlet.java","lineNumber":820,"className":"javax.servlet.http.HttpServlet","methodName":"service"},{"fileName":"ServletHolder.java","lineNumber":428,"className":"org.openqa.jetty.jetty.servlet.ServletHolder","methodName":"handle"},{"fileName":"WebApplicationHandler.java","lineNumber":473,"className":"org.openqa.jetty.jetty.servlet.WebApplicationHandler","methodName":"dispatch"},{"fileName":"ServletHandler.java","lineNumber":568,"className":"org.openqa.jetty.jetty.servlet.ServletHandler","methodName":"handle"},{"fileName":"HttpContext.java","lineNumber":1530,"className":"org.openqa.jetty.http.HttpContext","methodName":"handle"},{"fileName":"WebApplicationContext.java","lineNumber":633,"className":"org.openqa.jetty.jetty.servlet.WebApplicationContext","methodName":"handle"},{"fileName":"HttpContext.java","lineNumber":1482,"className":"org.openqa.jetty.http.HttpContext","methodName":"handle"},{"fileName":"HttpServer.java","lineNumber":909,"className":"org.openqa.jetty.http.HttpServer","methodName":"service"},{"fileName":"HttpConnection.java","lineNumber":820,"className":"org.openqa.jetty.http.HttpConnection","methodName":"service"},{"fileName":"HttpConnection.java","lineNumber":986,"className":"org.openqa.jetty.http.HttpConnection","methodName":"handleNext"},{"fileName":"HttpConnection.java","lineNumber":837,"className":"org.openqa.jetty.http.HttpConnection","methodName":"handle"},{"fileName":"SocketListener.java","lineNumber":243,"className":"org.openqa.jetty.http.SocketListener","methodName":"handleConnection"},{"fileName":"ThreadedServer.java","lineNumber":357,"className":"org.openqa.jetty.util.ThreadedServer","methodName":"handle"},{"fileName":"ThreadPool.java","lineNumber":534,"className":"org.openqa.jetty.util.ThreadPool$PoolThread","methodName":"run"}]}}

How can I subscribe to errors?

First of all simplifying webdriver communication! The API is shaping up pretty well.

I didn't quite understand how to subscribe to errors though.

I mean, I request a browser client.
If by any chance I type an erroneous URI on client.uri() I can see loads of info going to the console (with a screenshot and all) but I don't seem to be able to subscribe to it directly. How can I?

Tried, client.on('error', cb) and process.on('uncaughtException',cb)...

Thanks in advance.

Error in windows 7

Hi, I just installed webdriverjs following this steps:

  1. npm install webdriverjs
  2. npm install chai

and then stated selenium
java -jar node_modules/webdriverjs/bin/selenium-server-standalone-2.31.0.jar

my node version: 0.10.12
my npm version: 1.2.32
my phantomjs version: 1.9.1
I've installed phantomjs globally with npm install -g phantomjs

running provided example...
mocha node_modules\webdriverjs\examples\webdriverjs.with.mocha.and.chai.js

I got following errors:

[19:16:35]: COMMAND POST "/wd/hub/session"
[19:16:35]: DATA {"desiredCapabilities":> {"browserName":"phantomjs","version":"","javascriptEnabled":true,"platform":"ANY"},"sessionId":null}
[19:16:55]: ERROR COULDNT GET A SESSION ID
[19:16:55]: ERROR UnknownError An unknown server-side error occurred > while processing the command.
null
[19:16:55]: ERROR NO SESSION, EXITING
[19:16:55]: COMMAND POST "/wd/hub/session/:sessionId/url"
[19:16:55]: DATA {"url":"https://github.com/"}
[19:16:55]: COMMAND POST "/wd/hub/session/:sessionId/element"
[19:16:55]: DATA {"using":"css selector","value":".header-logo-wordmark"}
[19:16:55]: ERROR COULDNT GET A SESSION ID
[19:16:55]: COMMAND GET "/wd/hub/session/:sessionId/title"
[19:16:55]: ERROR COULDNT GET A SESSION ID
[19:16:55]: ERROR COULDNT GET A SESSION ID

0 passing (20 seconds)
2 failing

  1. my webdriverjs tests Github test:
    Uncaught TypeError: Cannot read property 'ELEMENT' of undefined
    at null. > (D:\pashaie\js\loadtest\node_modules\webdriverjs\lib\commands\getElementSize.js:> 8:44)
    at > D:\pashaie\js\loadtest\node_modules\webdriverjs\lib\utils\QueueItem.js:33:24
    at null. > (D:\pashaie\js\loadtest\node_modules\webdriverjs\lib\utils\RequestHandler.js:169:25)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:910:16
    at process._tickCallback (node.js:415:13)

  2. my webdriverjs tests "after all" hook:
    Uncaught AssertionError: expected undefined to equal 'GitHub ยท Build software > better, together.'

same time I got this error on java -jar node_modules/webdriverjs/bin/selenium-server-standalone-2.31.0.jar window

Jun 26, 2013 7:15:07 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
19:15:07.948 INFO - Java: Oracle Corporation 23.1-b03
19:15:07.950 INFO - OS: Windows 7 6.1 amd64
19:15:07.956 INFO - v2.31.0, with Core v2.31.0. Built from revision 1bd294d
19:15:08.030 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
19:15:08.031 INFO - Version Jetty/5.1.x
19:15:08.032 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
19:15:08.033 INFO - Started HttpContext[/selenium-server,/selenium-server]
19:15:08.033 INFO - Started HttpContext[/,/]
19:15:08.055 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@34fc265a
19:15:08.056 INFO - Started HttpContext[/wd,/wd]
19:15:08.058 INFO - Started SocketListener on 0.0.0.0:4444
19:15:08.058 INFO - Started org.openqa.jetty.jetty.Server@4893a582
19:16:35.543 INFO - Executing: [new session: {platform=ANY, javascriptEnabled=true, browserName=phantomjs, version=}] at URL: /session)
19:16:55.705 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_05'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:176)
at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:112)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:89)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:63)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:201)
at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:192)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:139)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:914)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_05'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:67)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:51)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:215)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:57)
... 9 more
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_05'
Driver info: driver.version: PhantomJSDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:111)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:115)
at org.openqa.selenium.phantomjs.PhantomJSDriver.(PhantomJSDriver.java:96)
at org.openqa.selenium.phantomjs.PhantomJSDriver.(PhantomJSDriver.java:85)
... 14 more
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_05'
Driver info: driver.version: PhantomJSDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:165)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:62)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
... 19 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:1832/status] to be available after 20001 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:163)
... 21 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
... 22 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130)
... 23 more

'before all hook' failure

After upgrading from 0.6.9 to 0.7.8 I have started getting this error when running previously passing tests :

Test Examples
1) "before all" hook

โœ– 1 of 9 tests failed:

  1. Test Examples "before all" hook:
    Error: timeout of 2000ms exceeded
    at Object. (/Users/ryan.crawford/Documents/Test Prototype 3/node-selenium-phantomjs-example/node_modules/mocha/lib/runnable.js:167:14)
    at Timer.list.ontimeout (timers.js:101:19)

This is the test I was trying to run:

describe('Test Examples', function(){ before(function(done) { client.init().url('http://localhost:3000/', done); });
describe('Check the homepage', function(){

    it('should see correct title', function(done) {
        client.getTitle(function(title){
            expect(title).to.have.string('Test');
            done();
        });
    });

Adding to not-running queue is broken

Consider this:

#!/bin/env node

var webdriver = require('webdriverjs'),
    pinky = require('pinky'),
    client,
    SELENIUM_HOSTNAME = process.argv[2],
    SELENIUM_PORT = process.argv[3];

client = webdriver.remote({
  desiredCapabilities: { browserName: 'firefox' },
  logLevel: 'silent',
  host: SELENIUM_HOSTNAME,
  port: SELENIUM_PORT
});

client.addCommand('foo', function(selector, callback) {
  this.execute('return null;', []);
  this.click(selector, callback);
});

var promise = pinky();

client
  .init()
  .url('http://google.com/')
  .isVisible('#hplogo', function(err, result) {
    // ...
  })
  .call(function() { promise.fulfill(); });

promise.then(function() {
  client
    .foo('#gbqfq', function(err, result) {
      console.log('mark 1');
    })
    .call(function() {
      console.log('mark 2');
    });
});

The output from this with version 0.7.8 will be:

mark 2
mark 1

The problem seems to have to do with QueueItem:

  1. init, url, and isVisible are called in series, and finally the promise done is fulfilled.
  2. At this point the currentQueueItem is call, with children = [], currentChildIndex = 0, isDone = true, and queueIsRunning = false
  3. foo is then queued to call, which sets queueIsRunning = true and runs foo.
  4. currentQueueItem is set to foo, and execute and click are queued to it. execute is then run.
  5. currentQueueItem is set to execute. execute starts an async request and returns.
  6. call is then queued to execute.
  7. The request started by execute is finished, and next() is called on the execute queue item, and call is run.
  8. click is run.

The workaround is to do something like this:

done.then(function() {
  var stopped = ! client.queueIsRunning;

  if (stopped) client.queueIsRunning = true;

  client
    .foo('#gbqfq', function(err, result) {
      console.log('mark 1');
    })
    .call(function() {
      console.log('mark 2');
    });

  if (stopped) client.currentQueueItem.next();
});

And the output is:

mark 1
mark 2

I am not sure what the best way to fix this is. Thanks for your work on this project.

How to see if a test is successful or not?

Is there currently a way to say that part X of test failed?

Also, if the part of the test that failed causes the rest of the test to stop running, is there a way to terminate the test early and jump straight to end?

I'd also like to see the same sort of functionality as assert and verify in selenium, so that you can say if X fails, carry on with the test.

In the end function, would be good to get back the number of tests that passed, failed and failed but we don't mind about... then we can link to something like the saucelabs module and send to saucelabs that our test has failed or passed.

I'm right in thinking that we can't do this currently?

I don't mind doing the work for this at all, but would like some feedback about how to implement such changes, don't want to just go and do it without consultation.

Dan

Client Processes Not Killed

I'm not sure if webdriverjs is responsible for killing client processes but since I create a client with webdriverjs, I think it does.

Below is how I create phantomjs client:

module.exports = require('webdriverjs').remote({
    // Settings
    desiredCapabilities: {
        // You may choose other browsers
        // http://code.google.com/p/selenium/wiki/DesiredCapabilities
        browserName: 'phantomjs'
    },
    // webdriverjs has a lot of output which is generally useless
    // However, if anything goes wrong, remove this to see more details
    logLevel: 'silent',
    // use a single client (+ session) for all tests..
    singleton: true
});

After the test suite ends, phantomjs processes continue to live at the back eating up the RAM. Since I run the test suite every N hour, after a while it becomes a problem.

Drag & Drop Support?

Hey Camme,

Correct me if I'm wrong... so webdriverjs uses JsonWireProtocol, which doesn't have drag/drop commands?

Thanks, :)
Quang

Connect to remote iPad

Hi all,

I have installed Selenium webdriver application on my iPad 2 in order to execute tests on it.

I succeeded to execute tests on the iPad by implementing test with Java.
I want to write the same test with Javascript and execute the it on the remote webdriver that installed on the iPad.

How can I connect to the remote webdriver by using webdriverJS?

Thanks,
Nir - SAP

Any Way to See If Click Is Successful?

I was wondering if there is anyway to determine if an element is clickable... I see you output to the terminal: Exception: Element is not clickable at point (-43, 744.5)

I was wondering if I could get something else other then this Exception.

I need this because for automating my website I sometimes have a transparent loading screen. And the element i need to click on is visible and it exist it is just not clickable at that moment.

If you have something that would test for this let me know.

Thanks,
Nick

waitFor() does not seem to chain properly

Chaining with waitFor() does not work for me:

 client.waitFor('selector', 3000)
        .getTitle()   .....

I have to use callback

client.waitFor('selector', 3000, function(err, cb){
     client.getTitle()...
     ....
}

I'm wondering if I did something wrong.
I checked lib/command/waitFor.js

        if(err === null) {
            callback(err, result);

It doesn't check typeof(callback)==='function', could this be causing the problem?
Thanks.

assert.textContains error

Hi, I found a tiny bug.

asserts.textContains.js at line 7.

- if (result.indexOf(expected) != -1)
+ if (result.value.indexOf(expected) != -1)

Error trying to implement local_storage protocol

Trying to implement some of the local storage capabilities, but keep getting the following error:

org.openqa.selenium.firefox.FirefoxDriver cannot be cast to org.openqa.selenium.htm5.WebStorage

Tried looking into the selenium group posts, but not having any luck. Anyone else tried this with any success?

driver is incredibly slow

When I switched from this driver to selenium-webdriver, my entire test suite went from 30-40 minutes to run to 7 minutes to run. I have noticed this library will randomly hang between commands for long periods of time.

The official selenium-webdriver library also threw a lot of errors that were not noticed by webdriverjs. I think this library is eating a lot of errors that it should be throwing :(

webdriverjs callbacks should follow the nodejs callback convention

http://docs.nodejitsu.com/articles/getting-started/control-flow/what-are-callbacks

The general idea is that the callback is the last parameter. The callback gets called after the function
 is done with all of its operations. Traditionally, the first parameter of the callback is the error value. If
 the function hits an error, then they typically call the callback with the first parameter being an Error 
object. If it cleanly exits, then they will call the callback with the first parameter being null and the rest
 being the return value(s).

/session/:sessionId/element/:id/value issues

Hi,

I wanted to do Keyboard actions like TAB,ALT,CTRL with WebdriverJs Json wire protocol.I could find /session/:sessionId/element/:id/value protocol in webdriverjs jsonWireProtocol list.

Can someone let me know how to send Keys in this protocol. For Example just TAB

Thanks

browserstack.com

Hi!

If you want to run the tests via BrowserStack, which attributes have to be add to the option object???

Regards

'client.setValue' merely appends instead of setting whole value on an 'input' of 'type' 'search'

For me, when I set the value the first time on a clear html 'input' field of type 'search', it works as expected. The second time around, 'setValue' merely appends. But there should be a separate method if appending functionality is desired.

I tried 'clearElement' beforehand, just on the off chance that might work since really, that should only clear text nodes and not attribute values.

partialLinkText

Is there any chance that this will be implemented in the future?

driver.findElement(webdriver.By.partialLinkText('Agenda') ).click();

Exception handling is great in webdriverjs compared to the selenium module, that is why is would be nice to have it implemented here.

Bug in Get Value for input field

I am trying to test a signup form by setting up a value in an input field of type text. When I try to get the value (after setting it), it returns undefined. I printed out the result object in getValue method. It doesn't have any value field which is why I get undefined.

Here is the snippet of result object

ce77d630-016d-11e3-91c4-51d845fc0ff6/element"
[20:34:49]: DATA {"using":"css selector","value":"input#firstName"}
[20:34:49]: RESULT {"ELEMENT":":wdc:1376105688968"}
[20:34:49]: COMMAND GET "/wd/hub/session/ce77d630-016d-11e3-91c4-51d845fc0ff6/element/:wdc:1376105688968/value"
I am here
{"status":0,"orgStatusMessage":"The command executed successfully."}

Can you please take a look into it?

Is there a way to handle errors if client fails to connect to remote?

Hi,

I'm sure i must be missing something, but I can't find a way to determine if the client fails to connect to the remote. I thought the init method would be a good candidate for receiving the error, but it doesn't seem to invoke the callback, it just logs an error to the console.

What do I need to register a callback with to handle this event?

Cheers
Pete

Checking HTTP statusCodes ?

Hey Camme,

Is there a simple way to check the http statusCode with webdriverjs? like... if(client.status == 200)

The JsonWireProtocol has a status() command, but I checked it out, it's returning status:0 so it might not be exactly what I was looking for...

...

I've noticed that protocol command client.url (POST) returns undefined, and I was trying to overwrite client.url with addCommand, but it doesn't seem like it's allowed:

if (self[commandName])
    {
      throw "The command '" + commandName + "' is already defined!";
    }

What do you think about allowing it? If there's an easier way to check statusCodes, let me know :)

If there's no other way, I guess I could use restler or something similar...

COULDNT GET A SESSION ID with selenium 2.35.0

var client = require("webdriverjs").remote();
client
    .init()
    .url('http://www.github.com')
    .getTitle(function(err,result){
        console.log(title);
    });

when run against java -jar selenium-server-standalone-2.35.0.jar gets the following

[21:04:32]:  COMMAND    POST     "/wd/hub/session"
[21:04:32]:  DATA        {"desiredCapabilities":{"browserName":"firefox","version":"","javascriptEnabled":true,"platform":"ANY"},"sessionId":null}
[21:04:34]:  ERROR  COULDNT GET A SESSION ID
[21:04:34]:  RESULT      {"platform":"MAC","acceptSslCerts":true,"javascriptEnabled":true,"browserName":"firefox","rotatable":false,"locationContextEnabled":true,"webdriver.remote.sessionid":"2cad4202-c5f8-44a9-97c8-1776fa641b8d","version":"16.0.2","cssSelectorsEnabled":true,"databaseEnabled":true,"handlesAlerts":true,"browserConnectionEnabled":true,"webStorageEnabled":true,"nativeEvents":false,"applicationCacheEnabled":true,"takesScreenshot":true}
[21:04:34]:  ERROR  NO SESSION, EXITING
[21:04:34]:  COMMAND    POST     "/wd/hub/session/:sessionId/url"
[21:04:34]:  DATA        {"url":"http://www.github.com"}
[21:04:34]:  COMMAND    GET      "/wd/hub/session/:sessionId/title"
[21:04:34]:  ERROR  COULDNT GET A SESSION ID
[21:04:34]:  ERROR  COULDNT GET A SESSION ID

works fine with 2.31.0

Npm Package breaks at version 0.7.10

Greeting,

we are pulling the latest package from npm, but after version bump to 0.7.10,
we are encountering the below error message and fail the build.

[email protected] postinstall /home/y/var/builds/workspace/td-stores-abu-content-trunk-component/app_root/node_modules/donkey/node_modules/webdriverjs
sh install.sh

Download selenium-server-standalone-2.35.0.jar into node_modules/.bin ....\n
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (77) error setting certificate verify locations:
CAfile: /usr/share/ssl/certs/ca-bundle.crt
CApath: none

Connect to remote samsung galaxy tab

Hi,

I've a problem with a remote connection on an android device (galaxy tab here).

I've install "android-server.apk" as explain here.

My js code is:

    var expect = require('chai').expect,
    webdriverjs = require('webdriverjs'),
    client = webdriverjs.remote({
        "host":'10.0.2.131', // Device IP
        "port": 8080, 
        "desiredCapabilities": {
            browserName:"android"
        }
    });

    describe('Run test 1', function() {
      beforeEach(function(done) {
        client.init();
        client.url('http://10.193.193.31/Testing/webdriverjsFeatMocha/', done); // desktop IP
      });

      // ....
    });

I use Mocha, so in my console I launch: mocha test1.js -t 15000

But I've an error:
bugWebdriverJS.jpg

When I launch with firefox I don't have any problem with firefox...

Did you know I can connect webdriverjs on my galaxy tab?

Thank you
Kevin

sendKeys / elementIdKeys does not work

I get this Java exception whenever trying to use client.sendKeys. I'm using selenium-server-standalone-2.31.0.jar

[17:47:36]:  COMMAND    POST     "/wd/hub/session/285cd63e-3a9c-4e99-b8f1-df626dbba187/element"
[17:47:36]:  DATA                {"using":"css selector","value":"#combobox"}
17:47:36.115 INFO - Executing: [find element: By.selector: #combobox] at URL: /session/285cd63e-3a9c-4e99-b8f1-df626dbba187/elemen
t)
17:47:36.126 INFO - Done: /session/285cd63e-3a9c-4e99-b8f1-df626dbba187/element
[17:47:36]:  RESULT              {"ELEMENT":"7"}
[17:47:36]:  COMMAND    POST     "/wd/hub/session/285cd63e-3a9c-4e99-b8f1-df626dbba187/element/7/value"
[17:47:36]:  DATA                {"value":"hello"}
17:47:36.129 WARN - Fatal, unhandled exception: /session/285cd63e-3a9c-4e99-b8f1-df626dbba187/element/7/value: java.lang.ClassCast
Exception: java.lang.String cannot be cast to java.util.List
17:47:36.131 INFO - WebDriver remote server: Fatal, unhandled exception: /session/285cd63e-3a9c-4e99-b8f1-df626dbba187/element/7/v
alue: org.openqa.selenium.WebDriverException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.8.0-20-generic', java.version: '1.7.0_21'
Driver info: driver.version: unknown
17:47:36.131 WARN - EXCEPTION 
javax.servlet.ServletException: org.openqa.selenium.WebDriverException: java.lang.ClassCastException: java.lang.String cannot be c
ast to java.util.List
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.8.0-20-generic', java.version: '1.7.0_21'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:206)
        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:167)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:139)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
        at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
        at org.openqa.jetty.http.HttpServer.service(HttpServer.java:914)
        at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
        at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
        at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
        at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.WebDriverException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.8.0-20-generic', java.version: '1.7.0_21'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:199)
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
        ... 16 more
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
        at org.openqa.selenium.remote.server.handler.SendKeys.setJsonParameters(SendKeys.java:39)
        at org.openqa.selenium.remote.server.rest.ResultConfig.setJsonParameters(ResultConfig.java:301)
        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:191)
        at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:192)
        ... 17 more
17:47:36.133 ERROR - /wd/hub/session/285cd63e-3a9c-4e99-b8f1-df626dbba187/element/7/value: 
org.openqa.selenium.WebDriverException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.8.0-20-generic', java.version: '1.7.0_21'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:199)
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:167)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:139)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
        at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
        at org.openqa.jetty.http.HttpServer.service(HttpServer.java:914)
        at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
        at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
        at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
        at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
        at org.openqa.selenium.remote.server.handler.SendKeys.setJsonParameters(SendKeys.java:39)
        at org.openqa.selenium.remote.server.rest.ResultConfig.setJsonParameters(ResultConfig.java:301)
        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:191)
        at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:192)
        ... 17 more

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.