I have the following test script:
if (GlobalVariable.rucniOdabirPacijenta){
WebUI.comment(“--------A---------”)
}
if (GlobalVariable.sendReport){
WebUI.comment(“--------B---------”)
}
Both of the above global variables are of boolean type and initially set to true
and false
, respectively.
-
When run inside of a test suite from cmd line, without overriding the global variables, the output is
2019-01-16 14:06:17.744 DEBUG testcase.premoscivanje globalnih - 1: if (rucniOdabirPacijenta)
2019-01-16 14:06:17.745 DEBUG testcase.premoscivanje globalnih - 1: comment(“--------A---------”)
2019-01-16 14:06:17.747 INFO c.k.k.c.keyword.builtin.CommentKeyword - --------A---------
2019-01-16 14:06:17.747 DEBUG testcase.premoscivanje globalnih - 2: if (sendReport)
This works as expected. -
The second run overrides the
sendReport
global variable:-g_sendReport=true
is added to the console line command. The output is as follows:
2019-01-16 14:07:10.200 DEBUG testcase.premoscivanje globalnih - 1: if (rucniOdabirPacijenta)
2019-01-16 14:07:10.201 DEBUG testcase.premoscivanje globalnih - 1: comment(“--------A---------”)
2019-01-16 14:07:10.202 INFO c.k.k.c.keyword.builtin.CommentKeyword - --------A---------
2019-01-16 14:07:10.202 DEBUG testcase.premoscivanje globalnih - 2: if (sendReport)
2019-01-16 14:07:10.203 DEBUG testcase.premoscivanje globalnih - 1: comment(“--------B---------”)
2019-01-16 14:07:10.204 INFO c.k.k.c.keyword.builtin.CommentKeyword - --------B---------
So, nothing strange here. -
The problem happens when I try to override the ‘rucniOdabirPacijenta’ variable with
-g_rucniOdabirPacijenta=false
. The output is:
2019-01-16 14:10:00.397 DEBUG testcase.premoscivanje globalnih - 1: if (rucniOdabirPacijenta)
2019-01-16 14:10:00.398 DEBUG testcase.premoscivanje globalnih - 1: comment(“--------A---------”)
2019-01-16 14:10:00.400 INFO c.k.k.c.keyword.builtin.CommentKeyword - --------A---------
2019-01-16 14:10:00.401 DEBUG testcase.premoscivanje globalnih - 2: if (sendReport)
So, GlobalVariable.rucniOdabirPacijenta
wasn’t overriden.