Currently encountering a peculiar issue with webdriverjs where it unexpectedly halts and appears to cease running events. My setup involves using webdriver to launch a new browser, after which the code in that browser links up to the webdriver session to execute test commands.
Initially, everything seems to be functioning as expected. However, certain sequences of commands cause webdriver to get stuck. For instance, in my test case:
driver.findElement(my_element).then(function(element) {
console.info("found");
element.getTagName().then(function(name) {
console.info("got tag name", name);
});
});
In this scenario, the browser prints out the first "found" message, but not the subsequent "got tag name". Strangely, there are no errors reported in the logs, and even if I set an errback for the getTagName
promise, it never triggers. It’s like the event just does not occur.
The webdriver instance is running on a selenium-standalone-server. By examining its logs, I notice the initial findElement
request being made:
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
However, the second request is missing, indicating that webdriver JS may not be triggering the server call as intended.
I am currently debugging through the webdriver code to identify the root cause, but due to the extensive use of closures in the promise
framework, inspecting the state proves challenging. Has anyone encountered a similar issue and can offer insights?