Forum Discussion

Dekks's avatar
Dekks
New Contributor
6 years ago
Solved

Using Global variables in Unit Script

Trying to learn scripting, and have a simple script that opens a webpage and logs in. I have successfully gotten this to work using local variables, however I want to use persistent variables that ca...
  • shankar_r's avatar
    6 years ago

    When you create a variable in the Project/ProjectSuite, It autocompletes after typing Project.Variables.

     


    Dekks wrote:

     

     

    Sub Login
    Dim Env
    Dim Variables
    Set Variables = ProjectSuite.Variables
    Env = Variables.VariableByName("PageLink")
    Browsers.Item(btIExplorer).Run Env
    End Sub 

    You do not need to go like this much lines code to get your variable. Just do like below after creating a variable.

    Browsers.Item(btIExplorer).Run ProjectSuite.Variables.PageLink