Software Development and QA Tips By QASource Experts

How To Prevent Webdriverio From Executing Too Fast?

Written by Timothy Joseph | Oct 19, 2020 4:00:00 PM

WebdriverIO is a Javascript-based automation framework. Since the framework adheres to asynchronous execution, the execution speed does not match. QA automation engineers can follow these two approaches in order to manage their Node.js based frameworks

Approach 1:

 "Callbacks or promises" can be used to handle asynchronous behavior, however promises are prefered over callbacks when handling code with more efficacy. You can check out an example of  implemented code below.

Approach 2:

You can also use "async and await". This will pause the function’s execution until the previous instruction is executed.