I am building an automation framework on top of Selenium (Node.js) consisting on a number of steps. Each step follows the previous one, after it completes, returning a promise (like the one returned by Selenium's driver.click(), etc). Is it possible to wait for a JavaScript event to trigger on the browser? If so, what is the pattern to follow?
-
do you mean wait until your java script fully executed and returned using selenium?Saurabh Gaur– Saurabh Gaur2016-06-09 11:23:14 +00:00Commented Jun 9, 2016 at 11:23
-
No, I meant what I said: wait for a JavaScript event to trigger. Waiting for a script to execute is trivial using driver.executeScript().Ricardo Peres– Ricardo Peres2016-06-09 11:32:40 +00:00Commented Jun 9, 2016 at 11:32
-
For example, I would like to inject window.onmessage = function() { ... continue with the node.js promise chain ... }Ricardo Peres– Ricardo Peres2016-06-09 11:33:31 +00:00Commented Jun 9, 2016 at 11:33
Add a comment
|