Skip to content

Getting Started with

itaiag edited this page Aug 9, 2016 · 1 revision

#Chapter 3: Started with JSystem Automation Framework

##3.1 JSystem Installation and Setup The following section will provide the step by step instructions required to install and configure your machine with the JSystem Automation Framework.

###3.1.1 Prerequisites The JSystem Automation Framework prerequisites require that the following elements are installed on your machine.

###3.1.1.1 Operating System Options

• Linux (Fedora 6/Debian/Ubuntu)

• Windows (XP/Vista) ###3.1.1.2 Software

• Java JDK 6.X

• Eclipse 3.3 or later

###3.1.2 Installing the JSystem Automation Framework The steps for installing JSystem Automation Framework are as follows:

  1. Once the java installation is verified, you can now proceed to download JSystem install , from here http://sourceforge.net/project/showfiles.php?group_id=116402

  2. Run the “jsystemInstall” application.

  3. Once the wizard is activated the “Welcome” step opens, click the “Next” button.

Figure 1: JRunner Installation Wizard 1

4.Define the directory path, or leave the default path setting and click “Next”.

Figure 2: JRunner Installation Wizard 2

5.Direct JSystem install to Eclipse root folder and press “Next”’

Figure 3: JRunner Installation Wizard 3

6.Now select the start menu folder, or leave the input field with the factory default settings intact, and now click the “Next” button.

Figure 4: JRunner Installation Wizard 4

Click the “Create a Quick Launch Icon” check box and or the “Create a Desktop Icon” if required, and then click the “Next” button.

Figure 5: JRunner Installation Wizard 5

7.Now wait for the JSystem Automation Framework installer to perform the JSystem Automation Framework installation.

Figure 6: JRunner Installation Wizard 5

8.To complete the JSystem Automation Framework Setup Wizard click the “Finish” button.

Note: The JSystem installer application creates a default RUNNER_ROOT environment variable which is set to the root folder of the JRunner application, for example, c:\jsystem\runner.

##3.2 Creating JSystem Development Environment Creating JSystem development involves creating new Eclipse workspace, importing the JRunner into the workspace and creating tests project.

###3.2.1 Creating a new Eclipse Workspace 1.In order to create a new Eclipse work space first open the Eclipse application and select “Switch workspace” from the file menu. The select workspace launcher window will open.

Figure 7: Eclipse Workspace Launcher

2.Enter the directory path for the new workspace and then click the “OK” button. The Eclipse application will now create a new folder if it does not already exist.

###3.2.2 Importing the JRunner Next step in creating the workspace is importing the runner. 3.Return to the Eclipse main interface and select “Import” from the file menu. The Import window will open as it appears here in the example.

Figure 8: Eclipse Import Window

4.From the Eclipse Import window select the “Existing Projects into Workspace” item from the “General” folder and click next. The “Import” window now appears.

Figure 9: Eclipse Import Window

5.Press on the “Browse” button, browse to the runner folder, select it and press “Ok”.

Figure 10: Browse For Folder Window

6.Next you should see the runner project selected in the import dialog main window:

Figure 11: Import Windows

7.Click “Finish”.

###3.2.3 Creating a Tests Project In order to create a new tests project perform the following steps. 1.Form the “File” menu select “New” and then select “Project”.

Figure 12: Creating a New Test Project 2.Once the “New Project” dialog opens, choose the JSystem folder and then select the “JSystem Test project”, and click “Next”.

Figure 13: JSystem New Project Wizard

3.In the New project dialog, you can see the list of System Objects available. In this session we won’t use JSystem System Objects, so just give your project a name and press “Finish”.

Figure 14: JSystem New Project Wizard 2

4.A test project with all relevant folders is created.

##3.3 Writing Your First Test Writing a JSystem test is as simple as writing a Junit test, since JSystem test is in fact an enhanced Junit test.

  1. Right Click on the newly created tests folder and select: “New->Class”

Figure 15: New Class Path

9.The “New Java Class” window now opens.

Figure 16: New Java Class Window

10.Enter the test class name in the “Name” input field. 11.Now press the “Browse” button and the type “SystemTestCase4” in the “Choose a type” field. 5.Now press the “Finish” button. 6.Insert the “helloJSystem” test method into your newly created class. Don’t forget the @Test JUnit annotation. 7.The following short code example illustrates a simple “Hello JSystem” Junit framework example.

package org.jsystem.quickstart;

import junit.framework.SystemTestCase4;
import org.junit.Test;
/**
*/
public class HelloJSystem extends SystemTestCase4 { 
    @Test public void helloJSystem(){
        report.report("Hello JSystem ");
    }
} 

Table 1: Your First Code Example

8.Now press the “Run” button in order to run the test.

Figure 17: Run Eclipse Test

9.If everything went well, you should see the following output in the Console windows:

10:08:08: Hello JSystem

Start time: Tue Nov 25 10:08:08 IST 2008

End time  : Tue Nov 25 10:08:08 IST 2008

Test running time: 0 sec.

Table 2: Your First Test Output

##3.4 Creating and Running Your First Scenario Now that you have created a simple test open the JSystem JRunner and run the test from within the JRunner application. In the workspace go to the runner project and activate the “run.bat” batch file.

Figure 18: Run JRunner Application Note: •If you are working on Linux, the JRunner can’t be activated from Eclipse, open a shell console change directory to folder and activate the “run” script (./run)

12.When opening JRunner for the first time the “Select SUT” window opens. Since the sample test does not use any SUT file, simply press “OK”.

Figure 19: Select SUT Window

Note: • When running JRunner for the first time after the installation, jsystemSerices example project is opened.

13.Once JRunner application starts, press on the “FileSwitch Project” to switch to your test project.

Figure 20: File->Switch Project Menu 14.Browse to the “classes” folder of the new project

Figure 21: Select Test classes Directory

15.Once the JSystem JRunner opens your newly created project, your test will appear in the “Test Tree” tab control on the right side of the JSystem JRunner.

Figure 22: JSystem Main JRunner Window 16.Now select the test and press the “Add tests” arrow button to add the test into the default scenario which appears in the left hand side of the JSystem JRunner window.

17.Now press the “Run Scenario” button to run the scenario.

Figure 23: JSystem Scenario Run Results ##3.5 Summary Now that the JSystem framework is installed and operational you can continue to the “Quick Start Project” (Chapter 11) where you will be introduced with basic JSystem services by implementing a small JSystem automation project.

Clone this wiki locally