Forum Discussion
eykxas
Frequent Contributor
I don't know if this workaround can help you, but in some Keyword I have to use variables for if else condition (for example).
(I work with Javascript language.)
I write this in script :
function AddVar(name, type){ Project.Variables.AddVariable(name, type); } function SetVar(name, value){ Project.Variables(name) = value; } function DelVar(name){ Project.Variables.RemoveVariable(name); }
Then I can use this three functions to create and modify variables during a KeywordTest by using Project.Variables.myVar
RajeshVV
7 years agoContributor
eykxas This is related to Project level variables. I need to create variables which can be created locally for each keyword test.
- eykxas7 years agoFrequent Contributor
I think you ca do the same thing with KeywordTest.
For example with this instruction (still for javascript) :
KeywordTests.NameOfKeywordTest.Variables.AddVariable()
and these :
var s; // Get the variable value s = KeywordTests.KeywordTest1.Variables.MsgVar; // -- or -- s = KeywordTests.KeywordTest1.Variables.VariableByName("MsgVar"); // Set the variable value KeywordTests.KeywordTest1.Variables.MsgVar = "New Value"; // -- or -- KeywordTests.KeywordTest1.Variables.VariableByName("MsgVar") = "New Value";
Related Content
Recent Discussions
- 3 days agovladd1