Forum Discussion
Hi
You can't do this in project variables inside IDE, but you can easily add value in script routine.
let obj = Project.Variables.Var1 = {param: "val", param2: "val2"};
- umakant6 years agoNew Contributor
Wamboo Thanks for your response.
Here is what I am trying to do
1. I have a object reference (Aliases.browser.pageSvl005epicno301EcmcLan8443Ep2) in my script routine
2. I would like to store it in Project Variable for Object type
3. Like you mentioned
let obj = Project.Variables.Var1 = {param: "val", param2: "val2"};
what does param: "val" referring to here. I am not sure about it? Please help me understand it.
Thanks,
Umakant
- tristaanogre6 years agoEsteemed Contributor
Basically, object type variables can only be assigned in code. So, you would have to do an assignment like
Project.Variables.Var1 = Aliases.browser.pageSvl005epicno301EcmcLan8443Ep2
You can't assign it ahead of time.
- Wamboo6 years agoCommunity Hero
Hi,
the 'val' it's the value you want to assign to object property. In my example you have a custom object which you want to fill with data from test routine.Check this website if you want to learn more about JS objects:
- TanyaYatskovska6 years agoSmartBear Alumni (Retired)
Related Content
- 10 years ago
- 13 years ago
- 10 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 6 days ago