filmov
tv
WebdriverIO How to implement Page Object Model

Показать описание
00:00 Intro
00:46 What is Page Object Model
03:04 Advantages of POM
03:22 DEMO How to implement POM in WebdriverIO Project
03:49 Sample demo application for testing
04:23 Sample Login test
16:20 Run demo test
16:54 Start of Page Object Model Implementation
17:08 Create class for each page
18:26 Create object locators in the login page class
21:24 Create functions for action on the objects
26:56 Refer the class in test script
30:30 Run POM test
33:06 Outro
*What is POM*
Design pattern to create Object Repository
A class is created for each page to identify web elements of that page
Also contains methods to do action on the objects
Separates test objects and test scripts
*Advantages of POM*
Makes code maintainable
Changes and updates are easier
Makes code reusable
Improves readability
Single Object Repository
Saves time and efforts
Avoid rework
Makes tests less brittle
New tests creation is easier and faster
Improves Overall quality and efficiency
Demo
How to implement Page Object Model
Step 1 - Create a class for each page
Step 2 - Create locators of all objects to be used in that page
Step 3 - Create methods or actions to be performed on the objects
Step 4 - Refer in the test scripts
Step 5 - Run and validate
class LoginPage
class LoginPage {
get username(){
return $('#username')
}
get password(){
return $('#password')
}
get loginButton(){
return $('button[type="submit"]')
}
get messageBox(){
return $('#flash')
}
async login(username, password){
}
async checkLoginMessage(message){
}
}
Login test
describe('Demo Test', () => {
it('Login Test', async () => {
})
})
*CI CD DEVOPS*
*UI TESTING*
*API TESTING*
*IDE*
*PROGRAMMING*
*RAGHAV PAL*
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can
*NEVER STOP LEARNING*
Raghav Pal
00:46 What is Page Object Model
03:04 Advantages of POM
03:22 DEMO How to implement POM in WebdriverIO Project
03:49 Sample demo application for testing
04:23 Sample Login test
16:20 Run demo test
16:54 Start of Page Object Model Implementation
17:08 Create class for each page
18:26 Create object locators in the login page class
21:24 Create functions for action on the objects
26:56 Refer the class in test script
30:30 Run POM test
33:06 Outro
*What is POM*
Design pattern to create Object Repository
A class is created for each page to identify web elements of that page
Also contains methods to do action on the objects
Separates test objects and test scripts
*Advantages of POM*
Makes code maintainable
Changes and updates are easier
Makes code reusable
Improves readability
Single Object Repository
Saves time and efforts
Avoid rework
Makes tests less brittle
New tests creation is easier and faster
Improves Overall quality and efficiency
Demo
How to implement Page Object Model
Step 1 - Create a class for each page
Step 2 - Create locators of all objects to be used in that page
Step 3 - Create methods or actions to be performed on the objects
Step 4 - Refer in the test scripts
Step 5 - Run and validate
class LoginPage
class LoginPage {
get username(){
return $('#username')
}
get password(){
return $('#password')
}
get loginButton(){
return $('button[type="submit"]')
}
get messageBox(){
return $('#flash')
}
async login(username, password){
}
async checkLoginMessage(message){
}
}
Login test
describe('Demo Test', () => {
it('Login Test', async () => {
})
})
*CI CD DEVOPS*
*UI TESTING*
*API TESTING*
*IDE*
*PROGRAMMING*
*RAGHAV PAL*
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can
*NEVER STOP LEARNING*
Raghav Pal
Комментарии