What to do when webdriverjs never cause continuation and just hangs?

I am running webdriverjs and have a problem when webdriver just idles and seems to stop triggering events. I use webdriver to launch a new browser, and then the code in that browser connects to the webdriver session and runs the test commands.

This seems to work fine, but then with some commands, the webdriver just nods. For example, in my test:

driver.findElement(my_element).then(function(element) {
  console.info("found");
  element.getTagName().then(function(name) {
    console.info("got tag name", name);
  });
});

The browser displays the first line of the "found" log, but not the second "name of the received tag". Webdriver does not work with an error - there are no exceptions in the log, and if I register an error in a promise getTagName, it will never be called. It just doesn't happen.

The webdriver instance is a standalone selenium server. Looking at his logs, I see the first request findElement:

12:59:43.382 INFO - Executing: [execute script: return (function lookupElement(id) {
  var store = document["$webdriver$"];
  if(!store) {
    return null
  }
  var element = store[id];
  if(!element || element[id] !== id) {
    return[]
  }
  return[element]
}).apply(null, arguments);, [51d37tw]] at URL: /session/1337200865492/execute)
12:59:43.393 INFO - Done: /session/1337200865492/execute

But I never see the second request, so it would seem that the webriver JS never ends the call to the server.

I look through the webdriver code to find out what is happening, but the structure promiseuses many closures, and it is very difficult to check the state efficiently. Is anyone familiar with this problem?

+5
source share
1 answer

This is a bug in WebdriverJS, confirmed and corrected by the selenium command. See http://code.google.com/p/selenium/issues/detail?id=3930

+2
source

All Articles