Git Product home page Git Product logo

java-selenium-testng-framework's Introduction

Selenium WebDriver TestNG Framework

Automating functional UI and end to end tests for www.oculus.com website. This project uses the page object model (POM) design.

Stack & Libraries

  • Java
  • Selenium WebDriver
  • TestNG
  • Maven
  • Extent Reports and logging

Prerequisites

  • IDE (Eclipse)
  • JDK (version 7 or 8)
  • Maven configuration

Easy way to configure Maven (Mac)

Click to view instructions
  1. Download Maven (tar.gz for mac) from here
  2. Move the downloaded apache-maven-3.6.3 folder to your Home directory (This is the folder with your username)

In terminal:

  1. Set system variables:
export M2_HOME=/Users/<YOUR USER NAME>/apache-maven-3.6.3/
  1. Append the Maven bin folder to the path:
export PATH=$PATH:/Users/<YOUR USER NAME>/apache-maven-3.6.3/bin/
  1. If you don't have a bash profile, create one:
touch .bash_profile
  1. If you do have one, or after creating one, open the bash profile to edit:
open .bash_profile
  1. Paste the two paths from step 1 and 2
  2. Save and close
  3. Now Maven will be installed for all sessions. To verify Maven is installed, type:
mvn --version

How to run tests

In terminal:

git clone https://github.com/ajkim0418/Java-Selenium-TestNG-Framework.git

Change directory to the location of cloned project folder and run Maven clean

mvn clean

To run the test

mvn test
Note: For the verifyLogin test case to pass, you must edit the SmokeTestSuite.xml and change the values for parameter "username" and "password" to a registered username/password

Project components

  • Page objects are in the directory src/main/java/pages
  • Test classes are in the the directory src/test/java/tests
  • Listener class is in the directory src/main/java/util

Highlights

  • This framework supports Chrome browser
  • This uses WebDriverManager, an open source browser binary manager. Selenium WebDriver requires you to download the binaries for each driver and hardcode the path of the driver. The disadvantage of this is each user must change the code to match their path, and they must manually check when new versions of the binaries are released. WebDriverManager automatically checks the latest version of the browser downloaded on your machine and downloads the required driver binary into the cache, eliminating the need to manually download and store binary files.
  • Screenshot on test failure: A screenshot of the active browser is captured and stored in the screenshots folder
  • Extent reporting and logging: After the test finishes, a visual report is generated for all the executed test cases from the suite. This report can be found in the 'report' folder TestResult

Screen Shot 2020-05-08 at 9 56 41 PM

java-selenium-testng-framework's People

Contributors

ajkim0418 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.