Forum Discussion
sbkeenan
10 years agoFrequent Contributor
Hi
You've not given us anything to work with unfortunately, i.e. what type of control, but typically, you need to create a variable and simply assign the 'Text', 'Value' or ContentText value to it. For example:
You will also need to consider the scope of the variable in deciding where you declare it. If you will be needing to use it in other methods, for example, you need to declare it outside of any method. If you need it to hold its value between test runs, etc. you will need to use project suite variable declaration, etc., etc. You should be able to get information on this quite easily in the help files.
Hopefully this is of some assistance.
Regards
Stephen.
You've not given us anything to work with unfortunately, i.e. what type of control, but typically, you need to create a variable and simply assign the 'Text', 'Value' or ContentText value to it. For example:
var myControl = <a reference to the control here>;
var myVar = myControl.Text; //or var myVar = myControl.Value, etc.
You will also need to consider the scope of the variable in deciding where you declare it. If you will be needing to use it in other methods, for example, you need to declare it outside of any method. If you need it to hold its value between test runs, etc. you will need to use project suite variable declaration, etc., etc. You should be able to get information on this quite easily in the help files.
Hopefully this is of some assistance.
Regards
Stephen.
Related Content
- 4 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago