I would like to know why global variables don't work

There are two testcases under one testsuite.

  1. Run the first testcase.
    ‘Ok’ is saved as a global variable in the ${test4} variable.
${test4}	   Set Variable	   Ok
Set Global Variable	  ${test4}	
Log To Console	        ${test4}	
  1. And if you check and run only the second testcase, ${test4} is not found.
    스크린샷 2023-01-07 오후 10.15.42

I want to know the reason.

After checking Testcase No. 1 and Testcase No. 2 together, if you run it, the log will come out normally.
But I want to run it alone.

Hi @picas1123 ,

Probably because you didn’t have the global variable a value (second argument of Set Global Variable)

You can refer to the examples in Set Suite Variable as per the documentation for Set Global Variable

Probably the easiest way to solve your issue is to modify the Set Global Variable to this:

Set Global Variable    ${test4}    ${test4}