Closed HolQue closed 2 months ago
Hi Holger,
we should allow
According to this rules
"teststring-1" : "teststring-1 value",
should raise an error that "-" is not allowed as part of a variable.
Now this brings me really in trouble... On jsonpreprocessor level it is allowed to define a variable with hyphen, json has no limitations for names, even spaces should be allowed as key? But: What is RobotFramework core doing if it reaches there?
Thank you, Thomas
Hi Thomas,
we should start with a smooth naming convention for stand alone JsonPreprocessor.
If it is necessary to strengthen this in case of the JsonPreprocessor is used in the context of RobotFramework AIO, this would be an issue for the TestsuitesManagement.
Update:
Now the error message is:
Error: 'The variable '${teststring-11}' is not available!'!
Suddenly '11' instead of '1'. From where does the '11' come from?
Still open.
Update:
Now the error message is:
Error: 'The variable '${teststring-11}' is not available!'!
Suddenly '11' instead of '1'. From where does the '11' come from?
Hello Holger, I pushed new commit 2c562386eef to stabi branch to correct the error message issue above.
Hello @test-fullautomation, can we move this naming convention ticket to next release after we have a discussion about this ticket.
Thank you, Son
'11
' issue from
https://github.com/test-fullautomation/python-jsonpreprocessor/issues/157#issuecomment-1822774616
is solved.
To answer the question in
https://github.com/test-fullautomation/python-jsonpreprocessor/issues/157#issuecomment-1746903631
JSON code passed to JsonPreprocessor:
"teststring-1" : "teststring-1 value",
${teststring-1} : "teststring-1 value new",
${teststring-1} : "${teststring-1} extended"
Outcome:
Error: 'The variable '${teststring-1} ' is not available!'!
Same JSON code - but with added scope 'params.global
' - passed to TestsuitesManagement:
"teststring-1" : "teststring-1 value",
${params.global.teststring-1} : "teststring-1 value new",
${params.global.teststring-1} : "${params.global.teststring-1} extended",
Works fine. Value of ${teststring-1}
is: 'teststring-1 value new extended'
Astonishing that the TestsuitesManagement works properly with code, that is not accepted by the JsonPreprocessor.
Why does the JsonPreprocessor not pass his error to the TestsuitesManagement?
Which behavior is the desired one?
Cross check with asterisk inside parameter name:
JsonPreprocessor:
"teststring*1" : "teststring*1 value",
${teststring*1} : "teststring*1 value new",
${teststring*1} : "${teststring*1} extended"
TestsuitesManagement:
"teststring*1" : "teststring*1 value",
${params.global.teststring*1} : "teststring*1 value new",
${params.global.teststring*1} : "${params.global.teststring*1} extended",
Outcome: Both components react with error: "Invalid parameter format in line: ...
"
Hi Holger, can I close this ticket? Thank you, Thomas
Hi Thomas,
some questions still not clarified:
Astonishing that the TestsuitesManagement works properly with code, that is not accepted by the JsonPreprocessor.
Why does the JsonPreprocessor not pass his error to the TestsuitesManagement?
Which behavior is the desired one?
https://github.com/test-fullautomation/python-jsonpreprocessor/issues/157#issuecomment-1907774471
Retest successful.
Both JsonPreprocessor and TestsuitesManagement are able to handle a parameter with name 'teststring-1
'
Issue can be closed.
integrated in RobotFramework AIO 0.11.0
The JSON code
causes
'The variable '${teststring-1}' is not available!'
Reason is the minus character inside the parameter name.
Outcome: We need to define and publish a naming convention for parameter names.
If minus characters are allowed, the expected value is:
{'teststring-1': 'teststring-1 value extended'}
If minus characters are not allowed, the expected result is an error message telling about a naming convention violation.
But that the variable is not available, should not happen.