Sunteți pe pagina 1din 8

Hello

Structure for automatic tests

I do not know yet if it is possible to combine automatic tests written in Ruby and tests written in Java

It's all to be verified

But first of all, we must try to have a standard

Since the NRT monitor uses well-defined parameters to perform the tests, I tell you how we can initially do
some sort of test

First of all,

Fig 1

Fig. 2
The structure to be integrated with the existing one, will be to create the [DIR] Selenium Files where to
insert your libraries

And the [DIR] TestSelenium where inside there must be the [DIR] of the various tests with the files File.jar
inside
Inside the [DIR] bat_nrt there will be the .bat files that will execute the file.jar, and will take in input some
parameters for the execution of the tests that I will explain later.

Inside the [DIR] batch, there will be subdirectories [DIR] with the name of the test and again of the
subdirectories [DIR] "goldmain", "production", etc .. with the name of the environment in which the test.

Within the [DIR] es: "goldmain", there will be the true file.bat that will be executed by the NRT Monitor.

This file.bat will call the .bat file inside the [DIR] bat_nrt

Ex: of the file.bat

.. \ AutomationTest \ Repotest \ batch \ chrome-germany \ goldmain \ chrome-germany_DE.bat

Fig.3

This [Fig.3] is the file that will be called by the NRT monitor.

Which in turn will run the file.bat below:

.. \ AutomationTest \ Repotest \ bat_nrt \ test-germany.bat -> see fig.44


Fig.4

Now let's go into detail:

The .bat -> chrome-germany_DE.bat [Fig.3] file, makes the set of some variables

set market = "DE" -> this Variable, in your case it may not even serve

set env_testing = "goldmain" -> this variable is the one to set which environment should be tested, and it
will be the one you will use to make the jar run

set authorization = "NRT" -> this only serves not to start the file.bat of fig.4 involuntarily by hand with a
double click
set browser = "chrome" -> this variable sets which browser should perform the test (chrome or explorer)

logically within the [DIR] batch, a [DIR] must be created with the suffix "explorer" instead of "chrome" and
inside the browser variable must be set with "explorer".

The .bat file of fig. 3, will eventually call the .bat file of fig.4

.. \ AutomationTest \ Repotest \ bat_nrt \ test-germany.bat

The file.bat of fig.4, takes the previously declared parameters into input, and sets others

let's go to set up:

path java: set path=%PATH%;C:\jdk1.8.0_201\bin

the path where the executable is located: set rjava=TestSelenium\germany\GermanyRun.jar

the path where it will eventually write the result and the test log:

set path_out=report_execute\%mydate%\%env_testing%\%test%

and finally after the various settings, it will run the test:

if %authorization_input%==%authorization% (

cd ..\..\..\

title %browser% - %titolo%

mkdir report_execute\%mydate%

mkdir report_execute\%mydate%\%env_testing%

mkdir %path_out%

echo %date% %mytime2% >> %path_out%\%mytest%_%mydate%.log

java -jar %rjava%

exit

As you can see from fig. 5, we can see the command execution window of the test, no matter where it is,
we must make sure that where it is put, it is always executable.
Fig.5

In figure 5 we note that it creates directoty: (mkdir ....)

These directories, create them under the file system and precisely under report_execute, then create the
[DIR] 20190304 (aaaammgg) of the day of execution, the [DIR] environment (goldmain) and the [DIR] of the
test that is executing (chrome-germany)

After that, go to write the file:

..\AutomationTest\Repotest\report_execute\20190304\goldmain\chrome-germany\chrome-
germany_DE_20190304.log dove all’interno c’è data e ora dell’esecuzione.

You have to make sure that your logs are written in this [DIR] that will be created at the time of execution
and eventually

Fig.6

NB: the file must be created the first time and if there is a second execution, it must go into append, ie it
must not overwrite anything.
Fig.6

You have to reverse yourselves something that goes to put under:

.. \ AutomationTest \ Repotest \ screenshots \ .. test screenshots, possibly using the same

This must surely be done by Java code

Form of log files, then for example:

..\AutomationTest\Repotest\screenshots\20190304\goldmain\chrome-germany\..

Referring to Fig.5, you should delete the integration with the user for which environment to perform the
test, and use the parameter:

env_testing see[ Fig.3 e Fig.4]

that is sent as a parameter to the file.jar to run the test in the requested environment.

PS:
as I watched your test run, I noticed that to access the link application, switch from magic to detach the
ticket.

If you succeed,

http://aittor16apcp600/gw/GetAuthTicket.asp?strUserNameAndGroup= “user”

es:

http://aittor16apcp600/gw/GetAuthTicket.asp?strUserNameAndGroup=0062230.d900

will give you back a string ache you only need to do the "encode"

after which you create the url to run the test ..

it saves time and is faster:

example:

I call url and pass him the


username:http://aittor16apcp600/gw/GetAuthTicket.asp?strUserNameAndGroup=0062230.d900

he returns me:

M98<E:Q\;8OV8A3O>FHG4\M9R-9%F32'#/H"3U-
]/51KWO@)QR5*3>+)W_(/=M^3?6IC53_77,F_[W.SXF>_N>_38D=%2#&SB%"O:VGG%-
#4@H.Z#@Y\[-W4C(MKS.2D3YL80B^SJE//$C8*3>N3;^*9PST-
[PN@MTX:LEA`MA^W"\\</&XY]=4I'\R?>`$=&EBKUL2@S@^>`%U:KSPMO>G03".I;%*=P
E3#?H-K\K+'K"\``
I do the encode:

M98%3CE%3AQ%5C%3B8OV8A3O%3EFHG4%5CM9R-9%25F32%27%23%2FH%223U-
%5D%2F51KWO%40%29QR5%2A3%3E%2B%29W_%28%2F%3DM%5E3%3F6IC53_77%2CF_%5BW.SXF%3E_
N%3E_38D%3D%252%23%26SB%25%22O%3AVGG%25-%234%40H.Z%23%40Y%5C%5B-
W4C%28MKS.2D3YL80B%5ESJE%2F%2F%24C8%2A3%3EN3%3B%5E%2A9PST-
%5BPN%40MTX%3ALEA%60MA%5EW%22%5C%5C%3C%2F%26XY%5D%3D4I%27%5CR%3F%3E%60%24%3
D%26EBKUL2%40S%40%5E%3E%60%25U%3AKSPMO%3EG03%22.I%3B%25%2A%3DPE3%23%3FH-
K%5CK%2B%27K%22%5C%60%60

And then according to the environment, the coupling:

if goldmine:

https://goldpatch-linkentry.fiat.com/pages/login/?__action__=do_login&upssaml=no&ticket=

if goldpatch:

https://goldmain-linkentry.fiat.com/pages/login/?__action__=do_login&upssaml=no&ticket=
if test

https://test-linkentry.fiat.com/pages/login/?__action__=do_login&upssaml=no&ticket=

if production

https://linkentry.fiat.com/pages/login/?__action__=do_login&upssaml=no&ticket=

and behind you hook

example

https://test-
linkentry.fiat.com/pages/login/?__action__=do_login&upssaml=no&ticket=M98%3CE%3AQ%5C%3B8OV8A
3O%3EFHG4%5CM9R-9%25F32%27%23%2FH%223U-
%5D%2F51KWO%40%29QR5%2A3%3E%2B%29W_%28%2F%3DM%5E3%3F6IC53_77%2CF_%5BW.SXF%3E_
N%3E_38D%3D%252%23%26SB%25%22O%3AVGG%25-%234%40H.Z%23%40Y%5C%5B-
W4C%28MKS.2D3YL80B%5ESJE%2F%2F%24C8%2A3%3EN3%3B%5E%2A9PST-
%5BPN%40MTX%3ALEA%60MA%5EW%22%5C%5C%3C%2F%26XY%5D%3D4I%27%5CR%3F%3E%60%24%3
D%26EBKUL2%40S%40%5E%3E%60%25U%3AKSPMO%3EG03%22.I%3B%25%2A%3DPE3%23%3FH-
K%5CK%2B%27K%22%5C%60%60

and this will be our url..

If this URL does not work,

http://aittor16apcp600/gw/GetAuthTicket.asp?strUserNameAndGroup=0062230.d900

go to your host file and add::

# NRT ticket

172.31.50.2 AITTOR16APCP600

S-ar putea să vă placă și