Skip to content

Chris-Dee/Sakai-Selenium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

Sakai-Selenium

##Overview This is a webapp to allow for easy upload of customizable selenium scripts generated from the Selenium IDE. This structure is meant to make it easier for organizations with limited technical QA personnel to move away from manual testing and towards the world of automated testing. This app allows users to upload Selenium scripts (which are checked against the format generated by the Selenium IDE), and URLs to run these scripts against. Users can then enter the app and run these scripts on any of the URLs that have been uploaded currently, and see the resultant output. Whether these scripts are full-blown tests or snippets to prepare manual tests, this app allows users to reuse commonly used clicks, or to actively develop a QA system. Also great for classes to develop a very lightweight, fast and easy storage platform for autmoated testing. ##Future Versions We would like to eventually have the following features in this app:

  1. We would like to fully sandbox the running of these scripts using pypy's sandoxed version, to ensure safety from custom scripts (this would allow for more flexibility in terms of what selenium files users could upload)

  2. We would like to allow an option for users to change the values of field entries (e.g. username, password, poll name) from the client side display

  3. We would like the parameters of an uploaded script to be stored along with the script in the database.

  4. We would like to do more pre-processing of the script in the server, so that users do not have to manually change the URL and add certain scripts

  5. We would like to move off of the unittest framework (unittest.main is a nightmare), and call individual methods, rather than have several workarounds to fit with the unittest.main function.

##Developer To run server, go to Sakai-Selenium/myproject and run

sudo python manage.py runserver 0.0.0.0:80

required dependencies are Python 2.7, Django 1.8, Selenium and firefox

To generate a script, download the firefox extension selenium-IDE, and record your clicks and actions. Then go to File/Export and export the script as a python unittest.

Your script must be uploaded from the Selenium IDE (or using the same import structure, as listed below), to help ensure that harmful code snippets are not accidentally run.

from selenium import ....
from selenium import ....
import unittest, time, re...

##Uploading Scripts Make a script through the Selenium IDE, and make sure that the sakai window on firefox is fully expanded when creating these.

export the script as python/unittest/webdriver script and save it.

If you want the URL your script is tested on to be variable (i.e. they can be changed on the frontend), follow the steps below. Otherwise, please put the URL your script is running on in the title of the script (should automatically be there)!

inside your script, before uploading, add the lines:

url = sys.argv[1]
del sys.argv[1]

and replace the line:

self.base_url = "http://xxx.xxx/"

with

self.base_url = url

Your saved script should then be good to upload and run thorugh the portal.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published