InfoStretch Test Automation Framework

Requirements and Settings Document

By Chirag Jayswal August 2011

©2011 InfoStretch Corporation. All rights reserved.

www.infostretch.com

1

Requirements and Settings Document

Index
I Prerequisites 1.1 Java (1.6 or Later) 1.2 ANT II III IV V VI VII Dir Structure Application Settings Configuration Settings Selenium Automation Execution Automation Test Results APPENDIX 7.1 Setup System Environment Variables IS Selenium Framework Download About InfoStretch 11 11 4 5 5 7 7 8 3

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

2

Requirements and Settings Document

I. Prerequisites
1.1 Java (1.6 or Later) To check whether java is already installed in the system the following steps are performed: 1. 2. Go to command prompt. Type javac -version

It will display the version of JDK in the system.

3.

Type java -version.

It will display the version of java runtime installed in the system.

If java is not present in the system, the following message is displayed: ‘java’ is not recognized as an internal or external command, operable program or batch file. If you don’t have java 1.6 or later installed then Java can be downloaded from the link given below online. http://www.oracle.com/technetwork/java/javase/downloads/index.html

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

3

Requirements and Settings Document

I. Prerequisites Continued
1.2 ANT To check whether Apache-ant is present in the system, perform the following steps: 1. Go to command prompt. 2. Type ant. If ant is not installed in the computer the following message is displayed: ‘ant’ is not recognized as an internal or external command, operable program or batch file. If above message is displayed then ant has to be installed in the system before running the aravo automation scripts. Ant can be downloaded from http://ant.apache.org/bindownload.cgi NOTE: You also required to check whether JAVA_HOME and ANT_HOME environment variable settled or not. To set it up please check appendix.

II. Dir Structure
The config directory contains testrun_config.xml file, and is a place holder for run configuration files. The lib directory contains required jar files, and is a place holder for other library jars/zips. The resources directory contains all required resources including properties files and data files, and is a place holder for other resources. The scripts directory contains ant script to build and run automation. It also contains bat file for windows environment. The Server directory contains selenium server jar. Download selenium server.jar from the SeleniumHQ website and place here if one not exists. The src directory contains all java files and is a place holder for other java files. The bin directory contains compiled classes, and is a volatile directory that is deleted by the target clean in build.xml file. The test-results directory contains result files.

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

4

Requirements and Settings Document

III. Application Settings
You can setup/verify application specific properties available under <TestAutomation_Project_root>\resources\application.properties. Few of them are described below: selenium.server It is used to set the selenium host, default is localhost. selenium.port It is used to specify port selenium uses, default is 4444. selenium.browser.url It is used to specify the web application base URL on which we will perform the tests. This is one of the important properties that need to be verifying for correct value. selenium.wait.timeout Specify the wait timeout period for wait service to use in different wait conditions, i.e. the amount of time in milliseconds. selenium.success.screenshots Set this flag to 1 when you want screenshot to be captured with every verification point. It is ideally set to 0, when it captures a screenshot only in case of a failure in the test case.

IV. Configuration Settings
One can configure test execution by modifying run configuration xml file available under <TestAutomation_Project_root>\config \testrun_config.xml This is a standard TestNG configuration file where you can customize your test run. One of the important configuration settings is browser to be used. It can be set by providing value for browser parameter in configuration file. <parameter name=”browser” value=”*chrome”/> Value can be any browser string supported by selenium. For IE it can be “*iexplore” or “*iehta”.

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

5

Requirements and Settings Document

IV. Configuration Settings Continued
Examples: You can run specific group, package, classes with include/exclude options. The configuration provided below will run all test cases from all classes in package “com.automation.test” <!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”> <suite name=”Test automation” verbose=”1” > <parameter name=”browser” value=”*chrome”/> <test name=”Sample test” > <packages> <package name=”com.automation.test” /> </packages> </test> </suite> Following will run test cases only form Suit1.java except TCEx <!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”> <suite name=”Test Automation” verbose=”1” > <parameter name=”browser” value=”*chrome”/> <test name=”Sample test” > <classes> <class name=”com.automation.test.Suit1”> <methods> <exclude name=”TCEx”></exclude> </methods> </class> </classes> </test> </suite>

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

6

Requirements and Settings Document

IV. Configuration Settings Continued
To specific group of test from configured classes/packages one can use method-selector. <!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”> <suite name=”Selenium web test Automation” verbose=”1” > <parameter name=”browser” value=”*iehta”/> <test name=”MockTests” > <method-selectors> <method-selector> <script language=”beanshell”><![CDATA[ groups.containsKey(“Transaction”) ]]></script> </method-selector> </method-selectors> <packages> <package name=”com.automation.test” /> </packages> </test> </suite>

V. Selenium Automation Execution
The following steps should be taken in order to execute an automation script. 1) Go to <TestAutomation_Project_root>\scripts. 2) Click on startSelenium.bat to start the selenium server. 3) Go to <TestAutomation_Project_root>\scripts\testRunner. 4) Click on seleniumTestRunner.bat to run the automation scripts for various test cases.

VI. Automation Test Results
After completion of script execution, test results will be found under <TestAutomation_Project_root>\test-results\<report-dir>\<Latest timestamp>. Open index.htm to view test results.

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

7

Requirements and Settings Document

VII. APPENDIX
7.1 Setup System Environment Variables Once java is successfully installed in the system, configure the java environment in the system by performing the following steps: 1. Right click on My Computer, and select Properties. 2. Go to Advanced tab and click on Environment Variables.The following diagram depicts some of the groups involved.

3. Go to system variables and add a new variable JAVA_HOME, if it does not already exist. 4. Enter the variable value as the install path for the Development Kit 5.

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

8

Requirements and Settings Document

VII. APPENDIX
5. Go to Path, click edit and add the java bin file path in the end. E.g. %JAVA_HOME%\bin

6. Go to system variables and add a new variable ANT_HOME, if it does not already exist.

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

9

Requirements and Settings Document

VII. APPENDIX
1. Write the ant file path in the variable value. 2. Go to Path, click edit and add the bin directory path in the end.E.g. %ANT_HOME%\bi6. Go to system variables and add a new variable ANT_HOME, if it does not already exist.

Test Automation Requirements and Settings
©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

10

Requirements and Settings Document

Download
Download the InfoStretch Selenium Framework http://www.infostretch.com/infostretch-selenium-framework

About InfoStretch
InfoStretch specializes in Enterprise Application Testing, QA and Test Automation Services with an emphasis on Enterprise 2.0 and Cloud Infrastructure-based SaaS applications. InfoStretch delivers high-quality, reliable and cost-effective services to clients throughout the US, Europe and Asia-Pacific. InfoStretch focuses on delivering business solutions that command deep technology knowledge, process proficiency and domain expertise.

InfoStretch is ready to help you with your specific needs.

Call us at (408) 727-1100

email info@infostretch.com
InfoStretch is a global leader in Mobile Application Development, Testing, Certification and Distribution; Quality Assurance Testing and Automation; Software as a Service (SaaS) Strategy and Enablement; and ERP Testing.

InfoStretch Headquarters SANTA CLARA, CA InfoStretch Corporation

2880 Lakeside Drive, Suite 200 Santa Clara, CA 95054 Phone (408) 727-1100 | Fax (408) 716-2461 info@infostretch.com | www.infostretch.com

InfoStretch Offices NEW YORK, NY AHMEDABAD, INDIA MUMBAI, INDIA

All registration marks are the property of their respective owners. ©2011 InfoStretch Corporation. All rights reserved. www.infostretch.com

11

Sign up to vote on this title
UsefulNot useful