Unset Global variable

200 views
Skip to first unread message

Geist Eng

unread,
Aug 25, 2019, 2:14:08 PM8/25/19
to robotframework-users
Can a Global variable be set in one suite's test and then unset in another suite's test?

I have a set of RF smoke tests for regression testing of my RF implementation, including custom libs in both RF and python.

A subset of suites is testing custom library import in various scopes.  So for the first time I have a need to set a new Global in a test case so the value can be seen in the next suite that is run.  

These suites have names to ensure they are run in order (e.g. 1__test.robot, 2__verify.robot) and I want to set in 1__, read it in 2__, then unset it in 2__ to prevent unneeded contamination of the run environment.

I understand this is minor issue.  I have searched this user groups past posting and reviewed RF users and BuiltIn docs and cannot find if this is  possible.


Abhishek Inani

unread,
Aug 26, 2019, 1:41:17 AM8/26/19
to geis...@gmail.com, robotframework-users
Hi Geist,

As far i think in RF there is no such Unset keyword to unset the variable value.

I think you can use:
In 1_  -->  Set Global Variable ${Variable1} SomeValue  (in suite variables)
This will work for 1_ and 2_
In 3_ --> Set Global Variable ${Variable1} NONE      (in suite variables)

This will set the value to NONE in 3_ test suite as NONE and it will be not available for rest of test suites

Thanks  & Regards
Abhishek Inani

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/41d09c27-247b-4410-845f-377e42b6fbd4%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages