I have this problem where I need to make a variable accessible from different keywords
I have Tried to use set global variable Keyword.
***Keywords***
Random Name
${Name}= Full Name
set global variable ${Name}
Keyword Name
Random Name
Log ${Name}
Keyword Name2
Random Name
Log ${Name}
*** Test Cases ***
Run Keywords
Keyword Name
Keyword Name2
Full Name Keyword
Import names
def Full_Name(self):
return (names.get_first_name())
Output
So in Keyword Name The value I am getting is John, but in Keyword Name2 The value is Clair. I need to keep the value as John for all of the keywords.
When i try to use the variable without passing the Keyword into the keyword I am not able to access it all.
I also Tried to use set suite variable but that has the Same Result.
Note: Full Name keyword is a custom library to get random names. also this is only a example code

Random Namein every keyword so it stands to reason you would get a random name in every keyword (assumingRandom Nameactually sets${name}to a random name).Random Namekeyword in every keyword because the global variable${Name}is not found otherwise, thats my problem, i need to use the${Name}without passing in the whole keyword. AndRandom Namedoes set${Name}to a random nameNo keyword with name 'Full Name' found.. When I fix the obvious error, both of the other keywords log "Full Name" just as I would expect.