Tuesday, January 15, 2013

Selenium Automation Frameworks






1
Selenium + Ant + Test NG
2
Selenium RC + PHPUnit + Ant
3


4


5


6


7


8


9


10








Selenium RC, Eclipse, Java - Hrmes framework
 

 
The HRMES is a test framework built for ALL testers of web based applications.
Supports Selenium RC, IDE, Grid etc.,  -   >> More


 
Selenium RC,TestNG, Eclipse

>> Video Clip 1

>> Video Clip 2

 
How to setup Selenium RC in Eclipse   - >> Video Clip
 
Setup Eclipse for Maven, TestNG, SVN, and Selenium  - >> Video Clip
 
One Good framework from Open2 site - >> More

Selenium Integration Testing For All Framework - >> Video Clip

Testing Testlink via Selenium RC - >> Video Clip

ROBOT Framework - Selenium RC & Java - >> Download from here      >> One more          >> another one
                                                     

                        

 Selenium & PHPUnit

Best Article ( step-by-step) to know the setup Selenium RC + PHPUnit - 
click here
 Best to learn & automate using Selenium with PHPUnit - click here  & 


                                                                                               - to download - www.phpunit.de

Integrating & Testing PHPUnit with Selenium - sebastian-bergmann.de

How to use Selenium - PHPUnit for automating functional tests - drupal

Selenium RC integration for PHPUnit - sebastian's github

Testing PHP/Web Applications with PHPUnit and Selenium - sebastian bergmann Video Clip

Pear site to download all the packages - click here 

Selenium Framework for PHPUnit - Mediawiki

Article on how to run phpunit with selenium RC - Devzone Article

Drunit - PHPUnit and Selenium RC integration for Drupal - Drunit

Exlusive Video clip for phpUnit y Selenium RC - >> Video clip

Article to how to install - PHPUnit, Testing_Selenium in Windows Vista - Click here ...

Blog from saucelab to integrate PHPUnit with Selenium - click here 

Yii framework - click here

Useful article with screenshots - click here   


Selenium RC & PHPUnit & Ant

How to integrate with ant script -- click here


Selenium & JUnit



A standard framework - Click here ...

Selenium RC with JUnit: -  
Click here ...




Selenium with JUnit & JMeter





Selenium Grid with PHPUnit

Integration of Selenium Grid with PHPUnit - video clip


Google code based frameworks







SAT - Selenium Ant TestNG Framework


Architecture


This framework is created using ANTTestNG and Selenium.
Through this framework, a user is able to create an automated test case which can be run later by executing a single command. The uses of different frameworks are as follows:
Selenium: This framework is needed for recording a testcase, exporting it into Java, and executing it on a browser
TestNG: This framework is used to organize different tests, and to report results.
ANT: provides the glue to hold everything together, and execute basic commands.

Pre-requisites:


Basic knowledge of Selenium IDE, Selenium RC, TestNG and ANT.

Setup:


1. Install Selenium IDE on your Firefox browser.
2. Make sure you have ANT installed.
3. Grab the testws.zip file from here. Unzip it into a directory of your choice.
About the sample 
There are 2 bundled samples:
1. AdminLoginTest.java: This test logs into the glassfish admin console using the username/password: admin/administrator. It then clicks on the 'Enterprise Applications' link, and tests to see if there are no applications deployed. Else, test will fail.
2. SimpleTest.java: This test accesses http://localhost:8080/ page, and tests whether the term "Glassfish Project" appears or not.
The config directory contains testng.xml file, and is a place holder for configuration files.
The lib directory contains required jar files, and is a place holder for other library jars/zips.
The test directory contains test java files and is a place holder for other test files.
Once the tests are run, build and test-output directories will be created.
The build directory contains compiled classes, and is a volatile directory that is deleted by the target clean in build.xml file.
The test-output directory contains result files, and is generated by TestNG.
Notes:
To run the bundled sample, follow the steps for "Execute your test through ANT" (see below).
Currently, I face some issues running this on IE. I have successfully been able to run tests using Firefox.

How To:


Write a test case
The basic structure that one has to follow to create a test case is:
1. Record a testcase using Selenium IDE (Firefox browser only), Export the test case into Java
2. Edit the test case – java file, and add TestNG annotations
3. Execute the test case using ANT
1. Record test using selenium IDE and export it into Java:
i. Open the website you’d like to test in Firefox browser
ii. Start the selenium IDE from your Firefox browser
iii. Ensure that the Base URL in Firefox is the same as the website you want to test
iv. Start clicking on the website. Selenium will record your actions.
v. When finished, do: File -> Export Test As... -> Java – Selenium RC and save the java file.
seleniumIDE-export.JPG
After exporting, your java test case should look like this:
selenium-java-test.JPG
2. Add TestNG to your test case:
i. Open the java test file you just created in an editor
ii. Add the following:
(a) to the import statements:
import org.testng.annotations.*; 
(b) To variable declarations:

private DefaultSelenium selenium;
private static String TIMEOUT_PERIOD ="10000";

(c) To The class:

@BeforeSuite(alwaysRun = true)
public void setUp(String browser) {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:8080");
selenium.start();
selenium.open("http://localhost:8080");
}
@AfterSuite(alwaysRun = true)
private void stopTest() {
selenium.stop();
}

(d) After each statement in the test that will take time for a page to load:

selenium.waitForCondition("selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD);

(e) On top of the test method:

@Test(groups = { "<your test group name>" })
e.g. @Test(groups = { "roller" })

(f) Edit page to be opened. Make sure arg to ‘open’ method of selenium points to the right context root e.g. Ifhttp://localhost:8080/<context_root> is the correct URL to test, then since we already have tried to open localhost:8080 in setUp, we only need to open the context root page.
e.g. 
selenium.open("<context_root>");
iii. Save the test file
(a). (Optional) Update testng.xml file. TestNG uses this file to read which groups to execute and also to pass parameters to the test. This file is only required if build.xml file uses testng.xml file to run the test.
Note: in sample test included, testng.xml is used, and will need to be updated.
iv. Ensure that the test file you created is mentioned in the build.xml compile target.
3. Execute your test through ANT
i. Start domain required by your webpage. e.g. asadmin start-domain
ii. Start database if needed (Not needed for bundled sample test)
iii. Start selenium server e.g. cd testws/lib, java -jar selenium-server.jar
iv. Execute the command: “ant run” from ‘testws’. You should see a new firefox browser window open up, and run through your test.
v. Check reports generated by TestNG under ‘testws/test-output’ directory. Open the index.html to see different output from the test.
SAT-html-output.JPG
Console output:

SAT-cmd-output.JPG