Skip to content

Documentation might need updating (Webdriver Promises) #6

Open

Description

@matfin

Hi,

I'm making good use of this module but can I suggest the following changes are added to the documentation:

  1. Regarding the promises as documented in the Selenium Webdriver JS documentation (on Google Code), they say to create a promise as follows:

var deferred = webdriver.promise.defer();

This is incorrect and I could not get it working. From looking at your source code it seems the following is correct:

var deferred = new webdriver.promise.Deferred();

  1. In the Selenium Webdriver documentation (on Google Code), we are told to call the following to resolve a promise:

deferred.fulfill();

This is incorrect and the following should instead be called:

deferred.resolve();

Hope this helps others who have been stuck with these problems.

Thanks,

Matt

Activity

  1. bernardlv commented on May 8, 2015

    @bernardlv

    Doesn't work. I'm trying to make this work for hours now. It's just TypeErrors of "undefined" all the time.

    var test = require('../testing'),
    webdriver = require('..'),
    until = webdriver.until,
    By = webdriver.By,
    driver;

    test.before(function() {
    driver = new webdriver.Builder()
    .forBrowser('firefox')
    .build();
    });

    [..]

    errorsDefer = driver.promise.Deferred();
    errorsDefer.resolve();

    "TypeError: Cannot call method 'Deferred' of undefined"

    errorsDefer = webdriver.promise.Deferred();
    errorsDefer.resolve();

    TypeError: Cannot call method 'resolve' of undefined

    EDIT: Actually the only thing you say wouldn't work, worked. I just didn't know I need the other namespace.

    errorsDefer = webdriver.promise.defer();
    errorsDefer.fulfill();
    return webdriver.promise.all(mainDefer);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions