Ask a Question

how to save text in TcxButtonEdit

SOLVED
yaacovk
Contributor

how to save text in TcxButtonEdit

I used user form to get configuration test from user

After last text insertion in TcxButtonEdit, I want to save text inserted in text property of TcxButtonEdit for next use.

Is there any option to save this text in TcxButtonEdit property?

Thanks

5 REPLIES 5
shankar_r
Community Hero

Using .Text property, you can get the text of an TcxButtonEdit component, 

https://support.smartbear.com/testcomplete/docs/reference/user-forms/properties/text.html

 

Sample code would be like,

 

function storeText()
{

     Project.Variables.storeMyText = Userforms.TcxButtonEdit_Sample.Text;
}

Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

Hi Shankar,

I want that this text will be save for another Project run.

Currently, your code save into a variable only for the current project run.

That is simple, ProjectSuite variables can be accessed across projects

 

Sample code would be like,

 

function storeText()
{

     ProjectSuite.Variables.storeMyText = Userforms.TcxButtonEdit_Sample.Text;
}

Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

I suppose you mean that between running some projects in project suite, ProjectSuite variables can be accessed across projects.

But I search to save this variable also after project run ends. Currently, your suggestion didn't solve my problem.

Thanks

Okay, If that is the case. 

 

  1. Create a Persistence variable in the ProjectSuite/Project.

From Smartbear doc:

 

Default Value A project can be shared between several testers working on different workstations (see Using Test Projects in Shared Mode). The variable values are computer-specific. Using the Default Value column, you can specify the value that will be used when the project is opened for the first time on the remote computer. Default Value is stored in the project file and it is common for all computers for all testers that use the project. If you modify a value in this column, the resulting changes will modify the Default Value for all users who share the project with you.

The default value cannot be set or read for Object type variables. The column displays {Object temporary variable [unassigned]} for these variables.

Local Value
This column is available only in the Persistent Variables section.

Specifies the current value of the variable. This value depends on the computer where the project has been opened. That is, the Value column holds the local value of the variable.

The value of the Object type variables can only be set or read during the script execution and cannot be changed from the editor. The Local Value column displays {Object temporary variable [unassigned]} for these variables.

 

2. Use that variable to store the text value.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

cancel
Showing results for 
Search instead for 
Did you mean: