Selenium
Selenium
Selenium
Testing
Install and explore Selenium for automated testing and a simple program in
JavaScript and perform testing using Selenium.
What is testing??
Software testing is the process of evaluating and verifying that a software product or
application does what it's supposed to do.
Testing includes an examination of code and also the execution of code in various
environments, conditions as well as all the examining aspects of the code.
Manual and Automation Testing
● Manual Testing:
○ The process of checking the functionality of an application as per the customer needs without taking any help
of automation tools is known as manual testing.
○ do not need any specific knowledge of any testing tool, rather than have a proper understanding of the product
so we can easily prepare the test document.
● Automated Testing:
○ Automation testing is a process of converting any manual test cases into the test scripts with the help of
automation tools, or any programming language is known as automation testing.
○ we can enhance the speed of our test execution because here, we do not require any human efforts. We need
to write a test script and execute those scripts.
API Testing
Understand the API documentation:
Login form Test that the user is able to login with the
correct credentials.
Test that the email and password fields are
mandatory.
Test that the user is redirected to the correct
page after login.
Enter all invalid details in the login form and
check if the user is able to log in successfully.
Test that the user can see a forgot password
link on the login page.
Try to log in with an already existing username
and check if the user is able to log in
successfully.
Expected Result:
The user should be successfully logged in and redirected to the homepage (or dashboard). A welcome message or the user’s
name should be displayed.
Postcondition:
Verify the user is logged in by checking for specific elements on the homepage (e.g., user profile, logout
button).
Additional Scenarios to Test:
Code implementation
Details:
1. Username and Password Field: Replace the IDs (username and password) with the actual attributes used on your login
page.
2. Login Button: Replace loginButton with the appropriate identifier.
3. Homepage Verification: Update the titleContains('Dashboard') or add a different element (like a welcome message or
profile link) for verification.
Steps to Run:
Save the file as testLogin.js.
node testLogin.js
Expected Outcome:
The script should navigate to the login page, enter credentials, click the login button, and verify
login success by checking for a specific element on the homepage (e.g., logout button).