Micro Focus QTP (UFT) Forums
Need Answer - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Need Answer (/Thread-Need-Answer)



Need Answer - ravi.chimmili - 10-03-2012

Question: how will we give values or Testing Data in below function code (in the place of X(0),X(1),X(2),X(3)...etc)

Code of the function is given below
Code:
function journey(byval x)
    with Browser(home)
        with .page(home)
          with .frame(lfrm)
            .image(flights).click
          end with
          with .frame(rfrm)
           .weblist(dcity).select x(0)
           .webedit(ddate).set x(1)
           .weblist(acity).select x(2)
           .webedit(rdate).set x(3)
           .webedit(nop).set x(4)
           .webcheckbox(rtrip).set x(5)
           .webradiogroup(sp).select x(6)
           .webradiogroup(st).select x(7)
           .image(cont1).click
          End with
        End with
    End with
End Function
Please get back to me ASAP

Thanks&Regards
Ravikumar C


RE: Need Answer - krr - 10-03-2012

Hi Ravi,

First assign all the data you need to variable x: as follows
x ="ravi,password,10032012,Deniver"

'''once you are into function split the x value seperated by delimitor ,
Code:
Function(x)
x=split(x,",")
''Now x(0) has value 'ravi"
''x(1) has value  "password" etc. You can use these values in the function,

End Function.



RE: Need Answer - krr - 10-04-2012

Did my solution answer your query?


RE: Need Answer - ravi.chimmili - 10-04-2012

Yes it is ok but not exactly the one i want


RE: Need Answer - krr - 10-04-2012

Ravi,

Let me know what are you looking for exactly.


RE: Need Answer - ravi.chimmili - 10-05-2012

like without using array and another function
we need to get data from excel sheet and that data we need to substitute


RE: Need Answer - krr - 10-08-2012

1.You can import excel to data table and assign the values to the respective fields.

2. Working with excel object to read data directly from Excel.

In these two ways you can work.


RE: Need Answer - ravi.chimmili - 10-09-2012

Hi,
We can get data from excel i know that but in the function we have just given one "X" how we will replace all variables in the given function