Introduction to WebDriverIO Tutorial
Following are the content by which you can be familiar with WebDriverIO:-
Note: All the terms and tools mentioned in this article will be explained in detailed in the upcoming sessions. Keep reading even though you don’t understand any terms and only understand this topic at a high level.
1) What is WebDriverIO ?
WebdriverIO is an open source testing utility for nodejs.
It basically sends requests to a Selenium server via the WebDriver Protocol and handles its response.
These requests are wrapped in useful commands and can be used to test several aspects of your site in an automated way.
In Simple Terms :-
2) Why you should consider using WebdriverIO over Selenium WebDriver?
Following are the reasons why you should consider using WebDriverIO over Selenium WebDriver :-
i) It’s Front-end Friendly
ii) It has the Power of Selenium
WebdriverIO uses Selenium beneath it, that simplifies to run my tests in all sorts of browsers.
Selenium, is an incredibly robust platform and an industry leader for running browser automation,and WebdriverIO stands on top of Selenium. As all the great things about Selenium are available, without the overhead of writing Java based tests.
iii) Simple to use
Commands you use in your WebDriverIO tests are crisp, concise and all about common sense.
WebDriverIO doesn’t make you write code to connect two parts together (Explained Below) which are obviously meant for each other.
For example, if I want to click a button via a normal Selenium script, I have to use two commands. One to get the element and another to click it.
It’s obvious that if I want to click something, I’m going to need to identify it.
WebdriverIO simplifies the ‘click’ command by accepting the element selector right in to the command, then converts that in to the two Selenium actions needed.
That means instead of writing the below:
I can just write the below:
iv) Page Objects
With the recent 4.x release of WebdriverIO, they introduced a new pattern for writing Page Objects.
For those unfamiliar with the term, Page Objects are a way of representing interactions with a page or component.
Rather than repeating the same selector across your entire test suite for a common page element, you can write a Page Object to reference that component.
Then in your tests, you just ask the Page Object for what you need and it handles it for you.
They’re easier to read because tests become less about the specific implementation of a page and more about what the page does.
For example, say we need to log in to our website for most of our tests. Without page objects, all our tests would begin with:
browser.url("login-page").setValue("#username", "test_`user").setValue("#password", "12345").click("#login-btn")
With page objects, that can become as simple as:
LoginPage.open(); LoginPage.login('test_user', '12345');
3) What are the prerequisites required for learning WebDriverIO ?
- Web-browser (In our case, Firefox)
Installations for all the mentioned pre-requisites will be explained in the upcoming sessions
4) What types of applications that WebDriverIO can and cannot Automate ?
WebDriverIO can automate both web applications and native mobile applications.
5) What all different browsers are supported by WebDriverIO ?
WebDriverIO supports all the below mentioned famous browsers in the market:-
6) What are the different Programming languages that are supported by WebDriverIO ?
7) What are the different version of WebDriverIO ?
Different versions of WebDriverIO API are :-
vi) v5.0 Latest one has Released on 19 December 2018.
8) What are the different testing frameworks supported by WebDriverIO ?
Some of the popular testing frameworks supported by WebDriverIO :-
> To learn more about WebDriverIO, continue to the next post (Click on Next Post link below)
> Check complete WebDriverIO Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?
On a mission to help the Software Testing Community in all possible ways.