Micro Focus QTP (UFT) Forums
how to pass the data frm datatable - 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: how to pass the data frm datatable (/Thread-how-to-pass-the-data-frm-datatable)



how to pass the data frm datatable - silpavinod - 10-17-2012

Code:
If a="Adidas"Then
        Msgbox "Sucess"
        Val1(j).click
        Exit for
    else
        wait(1)
    End If
Next

In the above code i need to pass the Adidas value from datatable... how to pass the data frm datatable

Code:
Set odesc=Description.Create
odesc("micclass").value="WebElement"
odesc("class").value="rcbItem  "
odesc("html tag").value="LI"
Browser("Link Express - Booking").Page("Link Express - Booking").WebElement("select").Click
wait(2)
Browser("Link Express - Booking").Page("Link Express - Booking").highlight
Set val=Browser("Link Express - Booking").Page("Link Express - Booking").ChildObjects(odesc)
val(4).click

In the above code i need to pass the 4th value from datatable... how to pass the data frm datatable


RE: how to pass the data frm datatable - Ankesh - 10-17-2012

syntax for getting values from datatable is

Code:
var=Datatable("<column_name>",<sheet_name>")

e.g., var=Datatable("Place",dtGlobalSheet)
here place is a column name in global datasheet. For local datasheet use dtLocalSheet.

Regards,
Ankesh


RE: how to pass the data frm datatable - agarwl.anurag - 10-17-2012

Hi,

You can pass the value through datatable as follows:

Code:
dim Var
Var=datatable.value(columnname,sheetname)

for example Var=datatable.value("Name","dtGlobal")

Thanks
Anurag


RE: how to pass the data frm datatable - silpavinod - 10-18-2012

Thanks for the reply
Here the prblm is val(4) means it is the 4th value in the dropdown. how can i pass this from datatable