Micro Focus QTP (UFT) Forums
Select does not work together with Environment.Value - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Select does not work together with Environment.Value (/Thread-Select-does-not-work-together-with-Environment-Value)



Select does not work together with Environment.Value - qtped - 02-10-2014

May some help me with the following syntax. For some reason my “Select” does not work with my “Environment.Value”. I am getting the following error message “Invalid procedure call or argument”

Code:
Browser("Browser Name").Page("Page Name").Frame("fsbottom").WebList("Dealer Code").Select Environment.Value("Dealer_Code")

When I change the Select statement to a number it works

Code:
Browser("Browser Name").Page("Page Name").Frame("fsbottom").WebList("Dealer Code").Select “1234”



RE: Select does not work together with Environment.Value - basanth27 - 02-11-2014

What does the msgbox pop? Does it show a value and if yes, what does it display?
Code:
msgbox Environment.Value("Dealer_Code")
Browser("Browser Name").Page("Page Name").Frame("fsbottom").WebList("Dealer Code").Select Environment.Value("Dealer_Code")



RE: Select does not work together with Environment.Value - qtped - 02-11-2014

I tried that and the Environment.Value("Dealer_Code") display correct value in a msgbox. However I still got the error msg on the next line

Code:
x=msgbox (Environment.Value("Dealer_Code"),0,"Wait Box")
Browser("Browser Name").Page("Page Name").Frame("fsbottom").WebList("Dealer Code").Select Environment.Value("Dealer_Code")



RE: Select does not work together with Environment.Value - supputuri - 02-12-2014

check the variable type... I doubt you might be getting an integer value from environment variable.


RE: Select does not work together with Environment.Value - qtped - 02-13-2014

Below is the syntax for Environment.Value("Dealer_Type")

Code:
Environment.Value("Dealer_Type")= DataTable.GetSheet("Sheet_Name").GetParameter("Dealer_Type")
Do you know the function/syntax that will convert to text


RE: Select does not work together with Environment.Value - ravi.gajul - 02-13-2014

As Supputuri mentioned, it looks like environment variable is not returning a string type.Try if this works.
Code:
Browser("Browser Name").Page("Page Name").Frame("fsbottom").WebList("Dealer Code").Select cstr(Environment.Value("Dealer_Code"))



RE: Select does not work together with Environment.Value - qtped - 02-14-2014

Hi ravi.gajul

This actually worked!!! what also worked is the following however it is more coding.

Code:
Dealer_Code = Environment.Value("Dealer_Code")
Browser("FundSERV Web Services").Page("FundSERV Web Services").Frame("fsbottom").WebList("Dealer Code").Select (Dealer_Code)

Thank you


RE: Select does not work together with Environment.Value - supputuri - 02-14-2014

Closing the thread as the issue is resolved.