Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get the input value from .vbs file to QTP Script?
#1
Solved: 10 Years, 9 Months ago
Hi,
I have a.Vbs file,here i am having input box

Code:
fav-env=inputbox("enter ur enviorn...")
if fav-env=A then
open link
elseif ....
open second link....

endif


I call this procedure in Qtp Script using the command
Call mainentra

Now I need this fav-env value for furthur functionality test.I want to keep this as for input parameter.How to store this value in to my QTp Script?
Any help?
Thank you,
Uma
Reply
#2
Solved: 10 Years, 9 Months ago
Hi Uma,

Before you enter the env value (ie:fav-env) into the input box ,save it to a variable ('inp_Var').
We know only once your condition is true the link in if loop will open.Hence if the correct link is open then verify your inp_Var with the input source..may be datable or another variable value.

There is also another method of reading your .vbs file and verifying the fav-env value.In qtp we have code for read and write text file.Please go through qtp help.

if wrong please correct me.

Thanks,
Himateja.
Reply
#3
Solved: 10 Years, 9 Months ago
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-----
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
'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
Reply
#4
Solved: 10 Years, 9 Months ago
Thank you both of you,
I try and put the final result.
Uma
Reply
#5
Solved: 10 Years, 9 Months ago
Ankesh,
It is working.
Thank you
Uma
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to input Japanese Character through UFT Alaguraja 0 785 07-01-2020, 11:32 AM
Last Post: Alaguraja
  How to get input from the user in QTP? shanthiK 10 18,054 08-07-2017, 11:34 PM
Last Post: zunebuggy
  Sending json file request and validating response in soap UI tool using Groovy script smiley 0 3,651 07-19-2017, 04:58 PM
Last Post: smiley
  Extract and save a file from zip folder using VB Script karthicksri07 1 6,189 06-29-2016, 02:19 PM
Last Post: Ankesh
  qtp script for updating values in xml file automation2012 3 11,260 11-30-2015, 11:07 AM
Last Post: Lavanya N

Forum Jump:


Users browsing this thread: 1 Guest(s)