Forum Discussion

yaacovk's avatar
yaacovk
Contributor
8 years ago

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

  • 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.

    • yaacovk's avatar
      yaacovk
      Contributor

      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.

      • shankar_r's avatar
        shankar_r
        Community Hero

        That is simple, ProjectSuite variables can be accessed across projects

         

        Sample code would be like,

         

        function storeText()
        {
        
             ProjectSuite.Variables.storeMyText = Userforms.TcxButtonEdit_Sample.Text;
        }