You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some automatic variables are only available in certain context: "Test Case", "Test Teardown", "Suite Teardown" and "User Keyword Teardown".
Could Robocop check that the variables are not used outside this context?
For instance, there is no warning for using "User Keyword Teardown" ${KEYWORD STATUS} directly in a test case:
*** Test Cases***My Test Case
Log ${KEYWORD STATUS}
This will fail with Variable '${KEYWORD STATUS}' not found.
However, this is a simple situation and others might be harder/not possible to work out?
For instance, using the ${TEST NAME} variable in a keyword might be legitimate when the keyword is used within a test case, but it fails when the same keyword is used in the suite setup or teardown.
In that case, I have used a TRY/EXCEPT block to deal with this situation, so I am not sure that Robocop could actually warn appropriately.
So maybe the rule should just warn that a variable as a limited scope and will not be available outside of Test Case for this particular example? Then the user can deal with it appropriately and ignore the error for this line.
The text was updated successfully, but these errors were encountered:
Some automatic variables are only available in certain context: "Test Case", "Test Teardown", "Suite Teardown" and "User Keyword Teardown".
Could Robocop check that the variables are not used outside this context?
For instance, there is no warning for using "User Keyword Teardown" ${KEYWORD STATUS} directly in a test case:
This will fail with
Variable '${KEYWORD STATUS}' not found.
However, this is a simple situation and others might be harder/not possible to work out?
For instance, using the
${TEST NAME}
variable in a keyword might be legitimate when the keyword is used within a test case, but it fails when the same keyword is used in the suite setup or teardown.In that case, I have used a TRY/EXCEPT block to deal with this situation, so I am not sure that Robocop could actually warn appropriately.
So maybe the rule should just warn that a variable as a limited scope and will not be available outside of Test Case for this particular example? Then the user can deal with it appropriately and ignore the error for this line.
The text was updated successfully, but these errors were encountered: