How do I programatically access the current webdriver instance?
-
26-12-2019 - |
Question
I'm writing an e2e test suite using Protractor.
I know it's built on top of WebdriverJS, and I'm trying to using some webdriverJS functionality.
Namely, I'm trying to enqueue some behavior using the webdriverJS' promise manager, and the WebdriverJS documentation says I should use
webdriver.promise.controlFlow().execute(function myBehavior(){...});
Trouble is, I don't know how to access that "webdriver" object. There is no global variable named "webdriver".
Can someone help me on this?
EDIT:
Now that the question has been solved, I'd like to highlight the fact that one must use
browser.driver.controlFlow()
and not
browser.driver.promise.controlFlow()
despite what WebdriverJS documentation may suggest.
Solution
The documentation says browser.driver
is the underlying webdriver.
So can you try this:
browser.driver.controlFlow().execute(function myBehavior(){...});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow