rainbowdriver / rainbowdriver-client

Selenium driver for WinJS Metro apps via JsonWireProtocol. The client files should be included on your winjs app.
1 stars 1 forks source link

Server crashes when invoking sendKeysToElement twice #1

Closed knorrium closed 12 years ago

knorrium commented 12 years ago

When we attempt to fill two different text boxes, the server crashes when sending the response.

http.js:644
    throw new Error('Can\'t set headers after they are sent.');
          ^
Error: Can't set headers after they are sent.

Caused by this block on jsonwire.js:

            session.connection.on('data', function (message) {
                var response = JSON.parse(message);
                if (response.name === "sendKeysToElement") {
                    res.send(200, {
                        "name": "sendKeysToElement",
                        "sessionId": req.params.sessionId,
                        "status": 0,
                        "value": response.value
                    });
                }
            });

I believe we must close the session connection before sending it again.

Will investigate this.

knorrium commented 12 years ago

Wrong repo.