Exforsys
+ Reply to Thread
Results 1 to 3 of 3

QTP: How do you assign a parameter in the Global DataTable into a Variable in QTP?

This is a discussion on QTP: How do you assign a parameter in the Global DataTable into a Variable in QTP? within the Software Testing forums, part of the Testing category; Hi everyone. I am trying to assign one of the parameters from my datatable into a Variable. Currently, I am ...

  1. #1
    abuzzi is offline Junior Member Array
    Join Date
    Dec 2007
    Answers
    2

    Exclamation QTP: How do you assign a parameter in the Global DataTable into a Variable in QTP?

    Hi everyone.

    I am trying to assign one of the parameters from my datatable into a Variable.

    Currently, I am attempting this by using the following syntax;

    Dim InvestTp
    Set InvestTp = DataTable("Initial_Investment_Tp", dtGlobalSheet)

    - however this is returning the error: "Object required: '[string: "1"]'

    Can anyone help me out by stepping me through the syntax needed to convert the value in my datatable into a variable?


  2. #2
    sussain is offline Junior Member Array
    Join Date
    Jul 2007
    Answers
    11
    Hi,

    Try like this...

    Actually, as per my knowledge, we dont use "SET" before the variables to which a value from datable is assigned.
    Try to assign that without using "Set"
    like
    InvestTP=DataTable("Initial_Investment_TP",dtGlobalsheet)

    I am sure it works.


  3. #3
    sukanya_QTP is offline Junior Member Array
    Join Date
    Apr 2008
    Answers
    8
    Quote Originally Posted by abuzzi View Post
    Hi everyone.

    I am trying to assign one of the parameters from my datatable into a Variable.

    Currently, I am attempting this by using the following syntax;

    Dim InvestTp
    Set InvestTp = DataTable("Initial_Investment_Tp", dtGlobalSheet)

    - however this is returning the error: "Object required: '[string: "1"]'

    Can anyone help me out by stepping me through the syntax needed to convert the value in my datatable into a variable?
    this is VB scripting and u don have to say set there
    InvestTp = DataTable("Initial_Investment_Tp", Global)
    this wud take value from the Initial_Investment_Tp column and put it in InvestTp


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...