Difference between revisions of "Users"

From Autodrive
Jump to: navigation, search
m
Line 85: Line 85:
 
|-
 
|-
 
|}
 
|}
 +
 +
''Directory structure''
 +
 +
It is recommended to use a directory structure enforcing separation of the driver and the scripts that need to run. This can be accomplished by the following structure:
 +
 +
* Automation
 +
** DriverBin
 +
** Scripts
 +
 +
DriverBin should contain a binary release of the autodriver project and the Scripts folder can be used as home for different automation projects. The autodriver has a selftest which is placed exactly under Scripts/AutoDriver.
 +
 +
Running ant -p should give a similar result as this:
 +
  <nowiki>ant -p
 +
Buildfile: build.xml
 +
 +
    This local build file is used for each project in order to be able to support the different test types
 +
    a project is sujected to.
 +
 +
    Autodriver suite without any system properties other than scriptdir and script set.
 +
 +
Main targets:
 +
 +
all              Execute all main test suites
 +
clean            clean up
 +
cmd              Command suite
 +
cookie            Cookie suite
 +
error            Error suite
 +
experimental      Experimental suite
 +
init              Execute all suites
 +
interrupt        Interrupt suite
 +
localdns          localdns suite
 +
logging          logging suite
 +
nestedscripts    nestedscripts suite
 +
oldbad            Old bad suite
 +
oldrun            Old run suite
 +
plugin            plugin suite
 +
reporting        reporting suite
 +
systemproperties  systemproperties suite
 +
util              Util suite
 +
Default target: all</nowiki>
 +
 +
For more information on how to use ant, pease consult the [http://ant.apache.org/manual/ Ant manual].
 +
 +
From here the automation suite can be executed by typing ant or ant with some target. The result of the execution can be found in the subfolder file htmlreport/index.html file created.
 +
 +
Currently there is a window script to aid in creating a new project setup. From the Scripts folder run:
 +
  <nowiki>create_template.bat myDemoProject</nowiki>

Revision as of 08:49, 28 February 2013

Userguide

This is the userguide descriping how to setup and run the autodriver.

Java version

Due to a bug in older versions of java when binding ports below 1024, JDK 1.7 should be used. To test which java version you got type:

java -version

Ant

For optimal use ant version 1.8.3 should be used. Ant is only a mean to provide an easy way to setup the execution environment. The driver could very well be started in other ways too. To test if ant if setup properly, type

ant -p

Either it complains about a missing build.xml or it will show which ant targets are available. All other results suggest a bad installation.

To provide system properties used in ant scripts set ANT_OPTS accordingly.

System properties

A set of system properties control the behavior of the driver. Each property is set by the –D option and has the form of name=value.

Main properties
Property Default Value
ad.stoponerrors false Whether to stop on errors or not
ad.scriptdir . script folder to load scripts from
ad.script N/A script to run at startup, if not set read from stdin
ad.suitename Default Specify an automation suite name for the report ad.startsuite False When true, previous reports are overwritten
Log properties
Property Default Value
ad.logtoconsole false When true, log to out stream and stdout
ad.loglevel INFO Log4j log level
ad.logoutput Autodriver.log Log4j logfile
DNS properties
Property Default Value
ad.localdns N/A hosts file to use for resolving dns entries
sun.net.spi.nameservice.provider.1 dns,LocalManagedDns
sun.net.spi.nameservice.provider.2 dns,sun
Advanced properties
Property Default Value
ad.properties N/A Property file to load for variable substitution
ad.plugin.list Used plugins
ad.threadInstances 1 Number of automation threads to run
Utility properties
Property Default Value
ad.messagequeuesize 5 MessageQueue size

Directory structure

It is recommended to use a directory structure enforcing separation of the driver and the scripts that need to run. This can be accomplished by the following structure:

  • Automation
    • DriverBin
    • Scripts

DriverBin should contain a binary release of the autodriver project and the Scripts folder can be used as home for different automation projects. The autodriver has a selftest which is placed exactly under Scripts/AutoDriver.

Running ant -p should give a similar result as this:

 ant -p
Buildfile: build.xml

    This local build file is used for each project in order to be able to support the different test types
    a project is sujected to.

    Autodriver suite without any system properties other than scriptdir and script set.

Main targets:

 all               Execute all main test suites
 clean             clean up
 cmd               Command suite
 cookie            Cookie suite
 error             Error suite
 experimental      Experimental suite
 init              Execute all suites
 interrupt         Interrupt suite
 localdns          localdns suite
 logging           logging suite
 nestedscripts     nestedscripts suite
 oldbad            Old bad suite
 oldrun            Old run suite
 plugin            plugin suite
 reporting         reporting suite
 systemproperties  systemproperties suite
 util              Util suite
Default target: all

For more information on how to use ant, pease consult the Ant manual.

From here the automation suite can be executed by typing ant or ant with some target. The result of the execution can be found in the subfolder file htmlreport/index.html file created.

Currently there is a window script to aid in creating a new project setup. From the Scripts folder run:

 create_template.bat myDemoProject