Skip to content

Latest commit

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Basic Framework to get you started with running UI tests using Selenium

This allows you to run UI tests using selenium webdriver. You can also run your tests in parallel by specifying the number of parallel threads as -DthreadCount= as runtime param.

Requirement

  • Java 11
  • Maven >3.0

Building the project:

  • You can build the project with maven goals clean install

How To Use

In order to include selenium-java-framework in your Maven project, first add the following dependency to your pom.xml:

<dependency>
<groupId>io.github.nsingla</groupId>
<artifactId>selenium-framework</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>

And also add following repository to your pom:

<repositories>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</repositories>

Examples to run tests

Simply extend your test class with SeleniumBase.java

importio.nsingla.selenium.SeleniumBase;
/** * This will enable your tests to fetch a webdriver object */classYourTestClassextendsSeleniumBase {
}

Available runtime parameters

ParamValuesDefault
modeLOCAL, REMOTELOCAL
browserchrome, firefox,
ie, edge, safari
chrome
headlesstrue, falsefalse
gridHostStringlocalhost
gridPortString4444
consoleloglevelOFF, SEVERE, WARNING,
INFO, CONFIG, FINE,
FINER, FINEST, ALL
OFF
localeen, es ...en
downloadPathStringnull
retryCountString0
threadCountString1
  • mode - To run tests locally or via grid
  • browser - To specify which browser to run tests in
  • headless - To run tests in a headless mode or via a GUI
  • gridHost - Selenium Grid hostname
  • gridPort - Selenium Grid Port Number
  • consoleloglevel - Log Level for logging
  • locale - to set browser locale (in case website picks it based on your location)
  • downloadPath - To specify a custom download path
  • retryCount - Number of times a test should retry if failed (find how to enable your tests to rerun on failure here)
  • threadCount - To specify how many tests you want to run in parallel (total across whole suite of classes)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages