Skip to content

Nyaxize/web_testing_project2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Selenium Test Framework (Java + JUnit)

πŸ“– Description

This project is a Selenium-based test framework for automating web application testing using Java and JUnit. It includes example tests for login validation, purchase flow on SauceDemo, and dynamic controls testing on Herokuapp.

βš™οΈ Requirements

  • Java Development Kit (JDK) 17 or higher
  • Chrome browser (version 114.0.5735.90 or compatible)
  • ChromeDriver (matching your Chrome browser version)
  • Selenium and JUnit libraries (included in the lib/ folder)

πŸ›  Installation

  1. Clone the repository:

    git clone https://github.com/Nyaxize/web_testing_project2.git
    cd web_testing_project2
  2. Add ChromeDriver:

    • Download the version of ChromeDriver matching your Chrome browser from ChromeDriver Downloads.
    • Place the chromedriver.exe file in the root folder of your project (or set its path in the code).
  3. Set up your development environment:

    • Use Visual Studio Code or any other Java IDE.
    • Ensure src/ and lib/ are added to your project's classpath.

πŸ“‚ Project Structure

java_web_testing_project/
β”‚
β”œβ”€β”€ lib/                  # Selenium and JUnit library dependencies
β”œβ”€β”€ src/                  # Source code for tests
β”‚   β”œβ”€β”€ HerokuappLoginTest.java       # Test for Herokuapp login page
β”‚   β”œβ”€β”€ HerokuappDynamicControlsTest.java  # Test for dynamic controls
β”‚   β”œβ”€β”€ HerokuappDropdownTest.java         # Test for dropdown selection
β”‚   β”œβ”€β”€ SauceDemoCheckoutTest.java         # Test for SauceDemo purchase flow
└── .gitignore            # Files to be ignored by Git

πŸš€ How to Run Tests

  1. Compile the tests:

    javac -cp "lib/*;src" -d bin src/*.java
  2. Run a specific test:

    java -cp "lib/*;bin" org.junit.runner.JUnitCore SauceDemoCheckoutTest

πŸ“ Notes

  • Ensure that your ChromeDriver version matches the installed version of Chrome.
  • The lib/ folder already contains the required .jar files for Selenium and JUnit.
  • If you encounter issues, check the browser and WebDriver compatibility or update paths in the code.

Happy Testing! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages