How To Prevent Webdriverio From Executing Too Fast?

Timothy Joseph | October 19, 2020

How To Prevent Webdriverio From Executing Too Fast?

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

Approach 2:

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

Approach

Disclaimer

This publication is for informational purposes only, and nothing contained in it should be considered legal advice. We expressly disclaim any warranty or responsibility for damages arising out of this information and encourage you to consult with legal counsel regarding your specific needs. We do not undertake any duty to update previously posted materials.

Post a Comment