Download the HTML5 Robot installer from here, which emails you a download link.

Double-click on the downloaded file to launch the installer.

install_1 install_2

Specify where to place the Gwen compiler along with the example Gwen, Java , and ExtJS projects.

  • The Java project contains all of the necessary jar dependencies along with an Ant build for executing the tests, as well as external Selenium Web Driver executables for Chrome and Internet Explorer.
  • The Gwen project contains example tests, an example run command, along with the Selenium Web Driver executables for Chrome and Internet Explorer.
  • install_3 install_4

 

The Java project will be installed to the following location: C:\Program Files\af-html5-robot-1.0\examples\java

Ready to Go

Assuming that you have some version of Chrome, Safari, Internet Explorer, and Firefox installed along with some version of Ant, you are ready to go.

cd C:\Program Files\af-html5-robot-1.0\examples\java

ant run-tests

The Java tests output a JUnit report to target/test-output, where the example output can be seen at http://html5robot.com/1.0/junit/.

The Gwen tests output an HTML report to target/gwen-output, where the example output can be seen at http://html5robot.com/1.0/gwen/.

IDE Integration

Create a project in your favorite IDE (like Eclipse), and just paste in the example source code.

In Eclipse a standard Java project will work, just remember to add all of the jars in the lib directory to the project classpath.

eclipse_libs

Directory Structure

The directory structure is the following:

  • drivers – This location contains the Selenium web drivers for browsers which require external services
    • chromedriver_win32_2.1
    • IEDriverServer_Win32_2.35.3
  • lib – This location contains all of the various jar files required to compile and run
  • src/main/java – This location contains the source code for the example tests
    • com/appfoundation/automation/example – Contains example Java browser tests
      • model – Model classes provide access to the HTML components on the page or pages being tested
        • Form1Model.java
        • Form2Model.java
        • Form3Model.java
        • Form4Model.java
      • test – Test implementation classes are browser specific, and typically just inherit from a base test and override individual test methods to deal with browser specific behavior
        • Form1ChomeTest.java
        • Form1FirefoxTest.java
        • Form1HtmlUnitTest.java
        • Form1IETest.java
        • Form1SafariTest.java
      • Form1TestBase.java – Runs a series of tests against form #1
      • Form2TestBase.java – Runs a series of tests against form #2
      • Form3TestBase.java – Runs a series of tests against form #3
      • Form4TestBase.java – Runs a series of tests against form #4
    • com/appfoundation/automation/gwenexample – Contains a hybrid solution where Java test load Gwen test files
      • Form1Test.gwen – Gwen equivalent of Form1TestBase.java
      • Form2Test.gwen – Gwen equivalent of Form2TestBase.java
      • Form3Test.gwen – Gwen equivalent of Form3TestBase.java
      • Form4Test.gwen – Gwen equivalent of Form4TestBase.java
    • log4j.properties – Sets the log4j logging level to DEBUG
    • properties – Contains properties that specify the location of the Web Drivers when running out of the IDE
  • build.properties – Contains properties that specify the location of the Web Drivers when running from the command-line
  • build.xml – An Ant build for running the tests using the target “run-tests”

What next?

See Test Structure