GithubHelp home page GithubHelp logo

joelworsham / getting-started-with-selenium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ddavison/getting-started-with-selenium

0.0 1.0 0.0 504 KB

Your starting Selenium 2 framework

License: Apache License 2.0

getting-started-with-selenium's Introduction

Getting Started

To get right up and started, you can download the project (zip) or you can checkout the project from github. If you don't know how, this should help.

Prerequisites

  • Maven (if using eclipse, install Maven Integration for Eclipse)
  • jUnit 4
  • Java
  • WebDriver (Chrome, Firefox, IE, etc)

Drivers

Currently, not all drivers are not packaged with this project, but they may be in the future!

Launch your IDE, and under src/tests/java you'll find a file under the functional package. This is a very short a simple test. If you do not have Chromedriver installed, just switch the browser to FIREFOX and right click the file and Run As -> jUnit Test

Goals

The primary goals of this project are to...

  • Take advantage of method chaining, to create a fluent interface.
  • Abstract the programmer from bloated scripts resulting from using too many css selectors, and too much code.
  • Provide a quick and easy framework in Selenium 2 using Java, to get started writing scripts.
  • Provide a free to use framework for any starting enterprise, or individual programmer.

In-line validations

This is one of the most important features that I want to accentuate.

  • validateText
  • validateChecked
  • validateUnchecked
  • validatePresent
  • validateNotPresent
  • validateTextPresent
  • validateTextNotPresent

All of these methods are able to be called in-line, and fluently without ever having to break your tests.

Switching Windows

Another nice feature that is offered, is the simplicity of window switching in Selenium.

  • switchToWindow(regex)
  • waitForWindow(regex)

Both of these functions take a regular expression argument, and match either the url or title of the window that you want to switch to.

Implicit Waiting

In addition to the Selenium 2 implicit waiting, the AutomationTest class extends on this concept by implenting a sort of waitFor functionality which ensures that an object appears before interacting with it. This rids of most ElementNotFound exceptions that Selenium will cough up.

See a working example of what a test script written using this framework might look like.

getting-started-with-selenium's People

Contributors

ddavison avatar

Watchers

Joel Worsham 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.