Professional Documents
Culture Documents
Get Started With Synthetic Monitoring3
Get Started With Synthetic Monitoring3
Selenium WebDriver promise manager / control flow allowed some functions to execute in order
in legacy runtimes, without managing promises. This capability was removed in Selenium
WebDriver 4.0 and is no longer available in the runtime. All async functions and promises need
to be managed with await or with .then promise chains. This will ensure script functions execute
in the expected order.
For example, promise manager / control flow could allow this partial script to complete
successfully, even though $browser.get returns a promise and the promise is not being handled
correctly:
$browser.get('http://example.com');
$browser.findElement($driver.By.css('h1'));
Copy
In the the Chrome 100 (or newer) runtime, any methods that return a promise need to use await
or .then syntax to properly sequence steps. Using await is recommended due to cleaner syntax
and easier usage, but .then promise chains are still supported too.
await $browser.get('http://example.com');
The Node.js 16 and newer scripted API runtimes use got instead of request. The request module
was deprecated in 2020 and will no longer be included in new API or browser based runtimes.
The $http object provides a custom request-like experience while being powered by got to
provide backward compatibility for basic use cases while still avoiding the use of a deprecated
module. Not all advanced use cases of request are or will be supported. Script examples and a
conversion guide are available.
TIP
The request-like experience provided by the $http object will also be returned for any customers
attempting to use request directly in Node.js 16 and newer scripted API runtimes.