Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User-Defined Environment Variable "blank"
#1
Not Solved
Hey all,

I'm kind of new to QTP, so bear with me. But, I need some assistance in retrieving the value of a user-defined Environment Variable.

Basically I have one action (login) that calls an existing reusable action (getclient).

The Getclient Action successfully sets 2 environment variables with a statement like: "Environment.Value("List") = excelSheet.Cells (2,1).Value" (It assignes the value from a cell in an excelsheet).

At this point in the test, everything is working fine because the getclient action successfully finishes and I can test with a MsgBox anywhere in there and it will have the values for the environment variables.

The issue arises later on when I try to call the environment variable values from another action after the Login action. In this new action I make a call like "Msgbox Environment.Value("List")" and it comes out blank, where in the getclient action it actually shows the value! This prevents me from passing the environment value into a new function, which is ultimately my goal.

I checked the test settings and under environment > User-defined, I have the variable "List" with no value. Could it be that the original "getclient" action is not correctly saving the environment variable value (from the excel sheet)? But if so, how come it works fine in that action? I am confused. Sad
Reply
#2
Not Solved
I guess the reusable action is residing in some other test otherwise all actions in your test should be able to see environment variables
Reply
#3
Not Solved
I store a number of actions in a Master test and call them from various other scripts, I can set and read environment variables between them without any issues. Are you sure your not clearing the value somewhere else before trying to re read it, i.e. at the end of the Getclient Action?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Not able to get the list of items in Delphi Combobox Environment Object Raj Aryan Singh 3 2,295 02-04-2020, 12:32 AM
Last Post: Raj Aryan Singh
  Error as Global Not defined while trying to retrieve value from Datatable siddharth1609 0 965 09-11-2019, 02:52 PM
Last Post: siddharth1609
  how to get relative path by using testdir environment variable Sathyaprasad 1 1,951 11-30-2017, 02:21 AM
Last Post: supputuri
  How to get input from the user in QTP? shanthiK 10 18,588 08-07-2017, 11:34 PM
Last Post: zunebuggy
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,907 09-13-2015, 12:06 AM
Last Post: ADITI1992

Forum Jump:


Users browsing this thread: 1 Guest(s)