GithubHelp home page GithubHelp logo

webscraperlogintest's Introduction

webScraperLoginTest

automated test for the login page on http://testing-ground.scraping.pro/login

These are my notes to setup an eclipse project that aims at testing a login page at: http://testing-ground.scraping.pro/login

This is written as a kind of framework that takes a csv file as test input (test cases variables are defined in there)

it is all written in java (requires java 8)

=========create the project==============

create a new project from the git repository (root of the project is the /testing folder)

add the git repository to your eclipse client:

Window > Show views > Other > Git > Git Repositories

click "clone a git repository"

use https://github.com/mattlrx/webScraperLoginTest.git as the repository url

specify a local folder on your machine to copy the files to

create a new java project, uncheck the option to use the default location and instead point to the location you set in the previous step

and browse to the testing directory.

==========set the build path ==============

to test the login page, I used Selenium java client (3.11.0), to set it up,

download selenium from the following page: https://www.seleniumhq.org/download/

or directly from https://goo.gl/Us5DnZ

extract the zip locally

add the jars to the build path

NOTE: the chrome driver has been included in the project. so no need to download it

to test the redirect page,

for the http client , download httpcomponents-client-4.5.5

from https://hc.apache.org/downloads.cgi

add httpclient-4.5.5.jar and httpcore-4.4.9.jar to the build path

also need commons-io-2.6.jar from https://commons.apache.org/proper/commons-io/download_io.cgi

=============optional - write test cases:==========

edit data.csv

the format is as follow:

test case name,script,start point url, expected result, data 1, data 2, data 3

for example: "Welcome Page",S,http://testing-ground.scraping.pro/login,h3 class='success'>WELCOME,admin,12345,true

there are 2 scripts:

S to login via Selenium

H to login using an HTTP client (this is to test the redirect page)

if you only want to run the first N lines, enter a line that starts with STOP and only the test data before this line will be loaded.

============execute the test:===========

to execute the test run the Main method in the TestDriver class.

after each test is executed the result of the test is appended in the test file defined as the report file.

once the test is completed, open loginTest.txt to see the test results

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.