Is it possible to declare a variable in a variable ?
Example :
var1 user
var2 /home/{$var1}/dir
I would like to do this in the "Edit vardiables" menu.
Thnx,
Efisio
Declaring variable in a variable
Re: Declaring variable in a variable
Hi Efisio,
Unfortunately, you cannot create variables dynamically.
I would suggest to implement it in the following way:
1) Add three variables to your recording module varUser will be combined with varPathPattern. The result will be stored in varPath
2) Create a new user code action which will perform this merge action (http://www.ranorex.com/support/user-gui ... tions.html)
3) Implement the method. The String.Format method will replace '{0}' with the variable varUser.
4) Now you should be able to use the path within your data driven test
I hope this solves your issue.
Unfortunately, you cannot create variables dynamically.
I would suggest to implement it in the following way:
1) Add three variables to your recording module varUser will be combined with varPathPattern. The result will be stored in varPath
2) Create a new user code action which will perform this merge action (http://www.ranorex.com/support/user-gui ... tions.html)
3) Implement the method. The String.Format method will replace '{0}' with the variable varUser.
Code: Select all
public void CreateFullPath()
{
varPath = String.Format(varPathPattern,varUser);
Report.Info("Path: "+varPath);
}
I hope this solves your issue.
You do not have the required permissions to view the files attached to this post.