DEV Community

Fleek It Solutions
Fleek It Solutions

Posted on

How to use webdriverIO with Javascript

How to use webdriverIO with Javascript?

Before starting how to use webdriverIO, you should have knowledge of why we use webdriverIO and what exactly it is . so let’s understand it.

Why WebdriverIO?

There are so many tools and frameworks that are used in Automation But If you are working on a front end site in automation testing, I’ll highly recommend you go with WebdriverIO. Following are some reasons:

Known for Simple accessible :
It has simple and easy to write syntax. The command which is used in WebdriverIO tests is very concise, easily understandable and to the point.

For Example, If I want to click on something(Web element) then, With A regular selenium webdriver you have to write “find element” by its name, id, CSS, partial text or XPath to locate that element and then you will be able to perform an action upon that element. That means Instead of writing this.

driver.find_element_by_id(“sbmtBtn”);

We can just write this:

client.click(‘sbmtBtn’)

So if it’s a CSS, partial text, id or XPath It can unravel for itself. There are also other selenium based tools out there but You should have knowledge about Python, Ruby or Java. and These languages are very verbose in comparison to WebdriverIO script.

Front end Friendly :
It makes the QA process easier, and it’s not only because of automation testing but also because the test code is written in Javascript – just like the frontend code. It works great for web browser applications which are in this case “front-end friendly”.

Another quality of webdriverIO is, we can use advanced and customized CSS selectors to locate elements. It is most liked not only because it looks nice but also about its readability and it is easy to start.

It has the capability of selenium:
WebdriverIO is not just the binding for webdriver protocol (like selenium). Selenium is an uncommonly robust platform. Most industries use selenium for running browser automation and WebdriverIO stands on top of selenium. All the essential features of selenium with additional utilities are available in webdriverIO with an easy syntax.

What is WebdriverIO?

WebdriverIO is a Javascript-based open-source project developed for the automation framework built over nodeJs. It is a good automation tool which can automate both web applications and native mobile apps. It is easy for testers to write selenium tests with Javascript in BDD(Behaviour driven development) or TDD(Test-driven development) test framework

https://www.fleekitsolutions.com/how-to-use-webdriverio-with-javascript/

Top comments (0)