Closed HolQue closed 2 months ago
Hello Holger,
I don't think the expected result of parameter newparam
is '1'
, as current JP behavior, the value "${dictP['${keyP}']}"
will convert ${dictP['${keyP}']}
to string.
In this case, it will convert "B"
to string, and the result is still "B"
Thank you, Son
Hi Son,
you're right.
And now it seem to me that the syntax in my example is invalid (because of the square brackets inside the curly brackets).
This should be the valid syntax version:
"newparam" : "${dictP}['${keyP}']"
Now newparam
is 'B'
.
Impact: The expected outcome of"newparam" : "${dictP['${keyP}']}"
now would be an error message about an invalid syntax.
And with this version
"newparam" : "${${dictP}['${keyP}']}"
newparam
has string value '1'
:-)
Hello Holger,
With this version "newparam" : "${${dictP}['${keyP}']}"
, the value will be converted to "${B}"
.
And ${B}
equal 1
, so it will convert "${B}"
to string '1'
:)
I will fix the issue you mentioned above.
Thank you, Son
Another possibility to freeze the JsonPreprocessor (with valid syntax now):
"keyP" : "A",
"B" : "keyP",
"dictP" : {"A" : "B"},
//
"newparam_1" : "${dictP}['${keyP}']", // => "${dictP}['A']" -> 'B'
"newparam_2" : "${${dictP}['${keyP}']}", // => "${B}" -> 'keyP'
"newparam_3" : "${${${dictP}['${keyP}']}}", // => "${keyP}" -> 'A'
"newparam_4" : "${dictP}['${${${dictP}['${keyP}']}}']" // => "${dictP}['A']" -> !!! freeze !!!
Hello Holger,
Regarding to your first comment with jsonp file:
"keyP" : "A",
"B" : 1,
"dictP" : {"A" : "B", "C" : 2},
"newparam" : "${dictP['${keyP}']}"
The value "${dictP['${keyP}']}"
is invalid format instead return string "B"
, it should be "${dictP}['${keyP}']"
as we defined before :)
I just want to correct the point above!
Thank you, Son I just want to ci
Hi Son,
this is what I told in
https://github.com/test-fullautomation/python-jsonpreprocessor/issues/226#issuecomment-1976506063
Hello Holger,
This ticket was solved on stabi branch!
Thank you, Son
Hi Holger, the problem occurs again? Thank you, Thomas
The code samples used above, work now.
But the JsonPreprocessor still freezes.
Now with this (invalid) code:
"listparam" : ["A","B","C"],
"param" : "$}${listparam}[0]"
Caution: The current freeze effect has an impact on the self test of the TestuitesManagement. This test also freezes!
Hello Holger,
I have just added mechanism to avoid Python run freezes to stabi branch.
For the issue related to invalid code "$}${listparam}[0]"
, I will check and fix.
Thank you, Son
Hi Son,
some details w.r.t. freezed TestsuitesManagement test: https://github.com/test-fullautomation/python-jsonpreprocessor/issues/226#issuecomment-1983106596
Freezing is TSM_1200
Affected JSON file:
Issue w.r.t.
"param" : "$}${listparam}[0]"
is solved. Result is: '$}A'
TSM_1200 still freezes.
Hello Holger,
I fixed the issue related to TSM_1200 freezes, could you please help me check!
Thank you, Son
Retest successful. Issue can be closed.
integrated in RobotFramework AIO 0.11.0
Hi Son,
with latest bugfix
https://github.com/test-fullautomation/python-jsonpreprocessor/issues/195#issuecomment-1975020184
the JsonPreprocessor freezes with this JSON code:
Expected:
newparam
has value'1'