Forum Discussion

Iso_Yura's avatar
Iso_Yura
Contributor
2 years ago

Issue with project suite variable.

I use to have a Var1 keyword test variable, then I removed it and created a new one Var2 but this time it's project suite variable.

 

When I run a keyword test under a project that is a child of the project suite every time the test step fails, I get the 'Exceptions".

In details it says: 

                           "The local variable "Var1" does not exist".
Var1 is the variable that was created as keyword test variable, which I removed and replaced by project suite variable. In the test step says Var2, but TC is looking for Var1 variable.
Before with Var1 variable the test was running without issues.
 

14 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Here's a JavaScript project example.

     

    I have a Project Suite variable defined as,

    I also have a Project Variable defined as

    Keys operation allows the follow parameters to be specified

    Choose the appropriate column

     

    Modify the Value, and select the appropriate variable that you want.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Decide what variable you want to use, either project suite or project variable, name or rename it appropriately, then modify the keyword test to use the correct variable?

     

     

     

     

    • Iso_Yura's avatar
      Iso_Yura
      Contributor

      I did it already. I attached screen shot where you can see that test step specify project suite variable but TC is expecting keyword test variable. 

       

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    I think what is wrong is your test is expecting "Project.Keywordtest."Yourtest".Variables.Var1" 

    But now you want to give it "Projectsuite.Variables.Var2"

    If you could post a screenshot of the test then maybe we could help you some more.

    • Iso_Yura's avatar
      Iso_Yura
      Contributor

      I realized that TC is looking for old variable, and this is the issue. As you can see in test step I specified new variable.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    In this example, I have one variable defined in project suite (orange) and another in project (cyan). Using keyword test, I'm using the Log operation to output both variables. 

     

    In your keyword test, does your project variable look like this ProjectSuite.Variables.QHZ_["Project_Name"] 

    ?

     

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Variable QHZ_["Project_Name"] is different to QHZ_.

     

    Modify your keyword test, and use the appropriate variable

     

    • Iso_Yura's avatar
      Iso_Yura
      Contributor

      I don't use any log message as you see.

      My variable is DB(excel) file with columns(more then one), I need to specify which column I want to use for this step.

      That's how I had before when I was using keyword test variable.

      Also, I have it like that in other tests ad it's working without issues when variable is a keyword test variable. But it doesn't work when it's project suite variable.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    To me it looks like TC is looking for a variable named "QHZ_["Project_Name"] " but that variable just does not exist.

    If you are using projectsuite variables or project variables you dont need to specify the project name

    • Iso_Yura's avatar
      Iso_Yura
      Contributor

      My variable is a DB(excel) file with columns. I need to specify which exactly column I want to use for this particular step. 

      This is what I have before when I had keyword test variable. 

      Without specifying Column it will not work.

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    Didn't notice that was the Column name

     

    Can you try using a Project variable instead of Projectsuite variable

    It will probably give the same result

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    What I had provided was just an example on how to use variables - this answers your original question. 

     

    The issue you are having now seems to be relating to database variable. When you don't provide enough information its difficult for us to provide a solution.

    • Iso_Yura's avatar
      Iso_Yura
      Contributor

      What additional information do you need to find a solution for the issue?