10-14-2011, 10:24 AM
Hi Uma,
The first thing that u need to do is to associate the .vbs file to QTP by navigationg to File->Settings->Resources. Here attach the .vbs file. Second point is that when u need some value(which is in ur .vbs file) to be used in ur script, u must return the value to the function... Chk the sample code below..
'----- function-----
'Now to call this function is ur QTP script, u can use the below code
FunctionReturnValue=Open_Link() ' Here FunctionReturnValue will have the value which u have enterd in Input box.
Do let me know if it does not work.
Regards,
Ankesh
The first thing that u need to do is to associate the .vbs file to QTP by navigationg to File->Settings->Resources. Here attach the .vbs file. Second point is that when u need some value(which is in ur .vbs file) to be used in ur script, u must return the value to the function... Chk the sample code below..
'----- function-----
Code:
Suppose ur function is
Function Open_Link()
fav_env=inputbox("enter ur enviorn...")
if fav_env=A then
open link
elseif ....
open second link....
endif
'Return the value to the function
Open_Link=fav_env
End Function
FunctionReturnValue=Open_Link() ' Here FunctionReturnValue will have the value which u have enterd in Input box.
Do let me know if it does not work.
Regards,
Ankesh