Skip to main content
summaryrefslogtreecommitdiffstats
blob: 625260ac0bf1d4ec40d5456cbc693f1983b50f23 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  Copyright (c) 2014 BREDEX GmbH.
  All rights reserved. This program and the accompanying materials
  are made available under the terms of the Eclipse Public License v1.0
  which accompanies this distribution, and is available at
  http://www.eclipse.org/legal/epl-v10.html
-->

<section xml:id="starting-java-auts" version="5.0" xmlns="http://docbook.org/ns/docbook"
                                               xmlns:xi="http://www.w3.org/2001/XInclude"
                                               xmlns:xl="http://www.w3.org/1999/xlink" >
  <title>Starting Java AUTs (Swing, SWT/RCP/GEF)</title>
  <anchor role="helpid" condition="autConfigSettingWizardPagePageContextId" xml:id="starting-java-auts.autConfigSettingWizardPagePageContextId" xreflabel="Configuring an AUT"/>
  <section xml:id="two-options-to-start-java">
    <title>Two options to start Java AUTs</title>
    <anchor role="helpid" condition="autConfigSettingWizardPagePageContextId" xml:id="two-options-to-start-java.autConfigSettingWizardPagePageContextId" xreflabel="Configuring an AUT"/>
    <anchor role="helpid" condition="autSettingWizardPagePageContextId" xml:id="two-options-to-start-java.autSettingWizardPagePageContextId" xreflabel="Defining an AUT"/>
    <para>
      There are two options to start your Java AUT for testing:
    </para>
    <variablelist>
      <varlistentry>
        <term>
          Via an AUT configuration:
        </term>
        <listitem>
          <para>
            This option means that you create an AUT
            configuration in your Project, and the AUT is
            started from the ITE (<xref linkend="configuring-a-java-aut-ite-start"/>).
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          Using the <emphasis>autrun</emphasis> command:
        </term>
        <listitem>
          <para>
            This option lets you start an AUT without creating
            a configuration. Certain start parameters are required
            for the AUT so that it can be located
            (<xref linkend="starting-java-with-the-command"/>).
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>
  <section xml:id="configuring-a-java-aut-ite-start">
    <title>Configuring a Java AUT to be started from the
    ITE</title>
    <para>
      The AUT configuration dialog for Java has three different
      levels of detail: basic, advanced and expert.
    </para>
    <para>
      See the sections below for information on the different
      levels.
    </para>
  </section>
  <section xml:id="basic-java-configuration">
    <title>Basic Java AUT configuration</title>
    <para>
      You can use the basic setting (<xref linkend="autconfigbasic"/>) to
      configure your AUT if it can be started by an executable
      file (e.g. .bat, .exe, .cmd, .sh etc.) and if it is written in
      Java 1.5 or above, and you are using a Java Standard Edition
      JRE.
    </para>
    <para role="warning">
      If you are testing RCP or GEF AUTs, there are certain specific steps you need to take to configure them. See the sections on RCP testing (<xref linkend="rcpaut"/>), GEF testing (<xref linkend="geftest"/>) for details.
    </para>
    <figure xml:id="autconfigbasic">
      <title>AUTconfiguration window: basic</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/autconfigwindow_basic.png"/>
        </imageobject>
        <textobject><phrase>AUTconfiguration window:
        basic</phrase></textobject>
      </mediaobject>
    </figure>
    <orderedlist>
      <listitem>
        <para>
          Enter the basic configuration details as described earlier
          (<xref linkend="basic-configuration-info"/>).
        </para>
      </listitem>
      <listitem>
        <para>
          Enter the executable file name in the
          <emphasis>Executable File Name</emphasis> field. This path can be
          relative if you define a working directory
          (<xref linkend="advanced-aut-config"/>).
        </para>
      </listitem>
    </orderedlist>
    <para>
      For information on the advanced properties for the AUT
      configuration, see the next section
      (<xref linkend="advanced-aut-config"/>).
    </para>
  </section>
  <section xml:id="advanced-aut-config">
    <title>Advanced AUT configuration</title>
    <para>
      You can use the advanced dialog (<xref linkend="autconfigadvanced"/>)
      to create a working directory for your AUT, and add command-line
      arguments needed to start the AUT. You can select a JRE executable
      and, for SWT/RCP AUTs, a keyboard layout.
    </para>
    <figure xml:id="autconfigadvanced">
      <title>AUTconfiguration window: advanced</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/autconfigwindowadvanced.png"/>
        </imageobject>
        <textobject><phrase>AUTconfiguration window:
        advanced</phrase></textobject>
      </mediaobject>
    </figure>
    <orderedlist>
      <listitem>
        <para>
          Enter the JAR path (directory and file name) into the
          <emphasis>Executable JAR File Name</emphasis> field.
        </para>
        <para>
          This path can be relative (if you define a working
          directory (<xref linkend="using-working-dir-aut-config"/>)), or absolute. This JAR
          file must contain a manifest file which contains the main
          class and the classpath.
        </para>
      </listitem>
      <listitem>
        <para>
          Enter any necessary command-line arguments for the
          AUT in the <emphasis>AUT Arguments</emphasis> field.
        </para>
      </listitem>
      <listitem>
        <para>
          Browse to a JRE executable or add a new one by clicking
          ”<emphasis>New</emphasis>”. The Java version used must be 1.5 or
          later.
        </para>
        <para>
          Java is installed with the ITE. You can find the Java file in:
          
          <emphasis role="menupath">Jubula</emphasis>--&gt;<emphasis role="menupath">jre</emphasis>--&gt;<emphasis role="menupath">bin</emphasis>. Use java.exe if you want to use a console, use javaw.exe if you do not want a console.
        </para>
      </listitem>
      <listitem>
        <para>
          For SWT and RCP AUTs, select which keyboard layout is
          used on the machine on which the AUT will run.
        </para>
        <para role="tip">
          The keyboard layout is not the actual keyboard attached to the computer, but is based on the regional language settings for the operating system.
        </para>
        <para>
          English (US) and German (DE) keyboard layouts are
          supported out-of-the box. If you want to use a different
          keyboard layout, see the Developer Manual for information
          on creating keyboard layouts.
        </para>
      </listitem>
    </orderedlist>
    <para>
      For information on the expert properties for the AUT
      configuration, see the next <xref linkend="expert-aut-config"/>.
    </para>
  </section>
  <section xml:id="expert-aut-config">
    <title>Expert AUT configuration</title>
    <para>
      You can use the expert dialog (<xref linkend="autconfigexpert"/>) to
      configure more detailed information about how the AUT
      should be started.
    </para>
    <figure xml:id="autconfigexpert">
      <title>AUTconfiguration window: expert</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/errorHighlighting.png"/>
        </imageobject>
        <textobject><phrase>AUTconfiguration window:
        expert</phrase></textobject>
      </mediaobject>
    </figure>
    <orderedlist>
      <listitem>
        <para>
          Add any additional desired <emphasis>JRE Arguments</emphasis>.
        </para>
      </listitem>
      <listitem>
        <para>
          Enter any required <emphasis>System Environment Variables</emphasis>,
          in the format ”<emphasis>&lt;VARNAME&gt;=&lt;value&gt;</emphasis>”,
          i.e. ”<emphasis>PATH=C:\</emphasis>”. Separate each
          variable with a new line by pressing <emphasis role="input">»ENTER«</emphasis>.
        </para>
        <para role="warning">
          Please be advised that ''embedding'' the contents of one
          variable into another is not supported at this time. That is,
          if you have a variable named <emphasis role="input">FOO</emphasis> whose value is
          ”<emphasis>abc</emphasis>”, and set the value of a second
          variable <emphasis role="input">BAR</emphasis> to ”<emphasis>%FOO%def</emphasis>”, the second variable will
          <emphasis>not</emphasis> contain ”<emphasis>abcdef</emphasis>”, but rather the exact text
          ”<emphasis>%FOO%def</emphasis>”, without evaluating it.
        </para>
      </listitem>
      <listitem>
        <para>
          Select an activation method for your AUT. More
          information on AUT activation is available in the
          previous <xref linkend="aut-activation"/>.
        </para>
      </listitem>
      <listitem>
        <para>
          If you want to perform monitoring (code coverage
          (<xref linkend="working-with-code-coverage-with-java-tests"/>) 
          then select this from the combo box.
        </para>
      </listitem>
      <listitem>
       <para>
       If you want the component at which an error occurs to get highlighted in
       the screenshot that is being taken, select the checkbox <emphasis>Component highlighting</emphasis>.
       </para>
      </listitem>
    </orderedlist>
  </section>
  <section xml:id="starting-java-with-the-command">
    <title>Starting Java AUTs with the <emphasis>autrun</emphasis> command</title>
    <anchor role="helpid" condition="autSettingWizardPagePageContextId" xml:id="starting-java-with-the-command.autSettingWizardPagePageContextId" xreflabel="Defining an AUT"/>
    <para>
      The <emphasis>autrun</emphasis> command can be used as an
      alternative to starting your AUT from the ITE. (i.e. with an
      AUT configuration (<xref linkend="configuringaut"/>)). It can only be used
      if your AUT is written in Java 1.5 or above, and you are using
      a Java Standard Edition JRE.
    </para>
    <para role="warning">
      The <emphasis>autrun</emphasis> command cannot be used
      for pure SWT AUTs.
    </para>
    <para>
      The command allows you to start your AUT independently, on a
      machine where the AUT Agent is running. The ITE, when
      connected to this AUT Agent will then recognize the running
      AUT as a testable application.
    </para>
    <para>
      To use the <emphasis>autrun</emphasis> command:
    </para>
    <orderedlist>
      <listitem>
        <para>
          Ensure that the AUT Agent is installed on the machine
          where you will be starting the AUT.
        </para>
      </listitem>
      <listitem>
        <para>
          Navigate to the <emphasis>server</emphasis> directory in
          the installation via the command line.
        </para>
      </listitem>
      <listitem>
        <para>
          Start your AUT via the command line by entering
          <emphasis role="input">autrun.exe</emphasis> under Windows or
          <emphasis role="input">autrun</emphasis> under Linux then the following
          parameters:
        </para>
        <table>
          <title>
            Parameters for autrun command
          </title>
          <tgroup cols="2">
            <colspec align="left" colwidth="40%"/>
            <colspec align="left" />
            <thead>
              <row>
                <entry>
                  <emphasis role="strong">Detail</emphasis>
                </entry>
                <entry>
                  <emphasis role="strong">Parameter</emphasis>
                </entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>
                  -h
                </entry>
                <entry>
                  <emphasis role="input">-h</emphasis><?linebreak?>
                  Gives parameter help
                </entry>
              </row>
              <row>
                <entry>
                  -w, <literal>--</literal>workingdir
                </entry>
                <entry>
                  <emphasis role="input">-w &lt;directory&gt;</emphasis><?linebreak?>
                  Enter the working directory for the AUT
                </entry>
              </row>
              <row>
                <entry>
                  -a, <literal>--</literal>autagenthost
                </entry>
                <entry>
                  <emphasis role="input">-a &lt;hostname&gt;</emphasis><?linebreak?>
                  Enter the hostname for the AUT Agent
                </entry>
              </row>
              <row>
                <entry>
                  -p, <literal>--</literal>autagentport
                </entry>
                <entry>
                  <emphasis role="input">-p &lt;port number&gt;</emphasis><?linebreak?>
                  Enter the port number for the AUT Agent
                </entry>
              </row>
              <row>
                <entry>
                  -swing
                </entry>
                <entry>
                  If the AUT is a Swing AUT
                </entry>
              </row>
              <row>
                <entry>
                  -rcp
                </entry>
                <entry>
                  If the AUT is an RCP AUT
                </entry>
              </row>
              <row>
                <entry>
                  -swt
                </entry>
                <entry>
                  If the AUT is an SWT AUT
                </entry>
              </row>
              <row>
                <entry>
                  -javafx
                </entry>
                <entry>
                  If the AUT is a JavaFX AUT
                </entry>
              </row>
              <row>
                <entry>
                  -k, <literal>--</literal>kblayout
                </entry>
                <entry>
                  <emphasis role="input">-k &lt;en_US&gt;</emphasis><?linebreak?>
                  Enter the keyboard layout for SWT/RCP AUTs
                </entry>
              </row>
              <row>
                <entry>
                  -i, <literal>--</literal>autid
                </entry>
                <entry>
                  <emphasis role="input">-i &lt;ID&gt;</emphasis><?linebreak?>
                  Enter the ID to give to this AUT
                </entry>
              </row>
              <row>
                <entry>
                  -e, <literal>--</literal>exec
                </entry>
                <entry>
                  <emphasis role="input">-e &lt;AUT.exe&gt;</emphasis><?linebreak?>
                  Enter the executable file for the AUT<?linebreak?>
                  This must be the last parameter in the command line
                </entry>
              </row>
              <row>
                <entry>
                  -g, <literal>--</literal>generatenames (optional)
                </entry>
                <entry>
                  <emphasis role="input">-g &lt;true/false&gt;</emphasis><?linebreak?>
                  For RCP AUTs, enter whether<?linebreak?>
                  to generate technical names. (<xref linkend="define-aut"/>)
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </listitem>
    </orderedlist>
    <para role="tip">
      If your AUT is an RCP AUT, use
      <emphasis role="input">-data'&lt;WORKSPACE&gt;'</emphasis> after the executable
      file to specify the workspace the AUT should use.
    </para>
  </section>
  <section xml:id="create-aut-def">
    <title>Creating an AUT definition from a running AUT</title>
    <para>
      Once you have started an AUT using the
      <emphasis>autrun</emphasis> command, you can automatically
      generate an AUT definition (<xref linkend="define-aut"/>) for this AUT:
    </para>
    <itemizedlist>
      <listitem>
        <para>
          In the Running AUTs View, select the AUT you want to
          define (it will be marked as an unknown AUT ID).
        </para>
      </listitem>
      <listitem>
        <para>
          Select:
        </para>
        
        <para>
          <emphasis role="menuPath">Create AUT Definition</emphasis>
        </para>
        
        <para>
          from the context menu.
        </para>
      </listitem>
      <listitem>
        <para>
          The AUT definition window will appear. Complete the dialog
          (<xref linkend="define-aut"/>) and click ”<emphasis>OK</emphasis>”.
        </para>
      </listitem>
    </itemizedlist>
  </section>
</section>

Back to the top