Skip to content

Problem with driver.executeScript #2

@abahdanovich

Description

@abahdanovich

I'm trying to execute examples/hello.js example with selenium-server/chromedriver. It looks like fine, but at the end it finishes with no results. It looks like

return driver.executeScript(function () {

returns deferred object (why?), which, I suppose, must be resolved before next then block:

results.forEach(function (result) {

but result variable is an empty array.
When I try to debug that deferred object:

results = driver.executeScript(.....
result.then(function(r) { console.log(r); })

I get correct results.
When I use phantomjs, everething goes the same way except that the last then(function (results) gets correct array of values and everything works fine.

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