Results 1 to 7 of 7

Thread: Value of a single variable (column) into data table

  1. #1
    Geek_Guest
    Guest

    Value of a single variable (column) into data table

    How do we write the value of a single variable (column) into the data table?

    Question asked by visitor Deepa


  2. #2
    Contributing Member
    Join Date
    Feb 2006
    Answers
    85

    Re: Value of a single variable (column) into data table

    Well ur Q is not very clear but if you mean how you can pass some value from the test to the Data sheet then you can use the getParameter function
    Ex:
    DataTable.GetSheet("Global").GetParameter("Create_Product").Value="pass the value here"

    Let me know if you have any Q or if i misunderstand your question.

    Thanks,
    Kunal Shekhar


  3. #3
    Junior Member
    Join Date
    Aug 2009
    Answers
    1

    Re: Value of a single variable (column) into data table

    Hi Kunal, I have used this code i replaced the column name with RequestNumber.
    but though the test passed, it does not put the value to the data table.

    The variable to which value is assigned is reqno. and column name is RequestNumber.
    and reqno is the variable which has value REQ0043215,Now i need to display REQ0043215 in the datatable.
    so i wrote the code as

    DataTable.GetSheet("Global").GetParameter("RequestNumber").Value="Reqno"
    Can you please identify where am i going wrong?

    Last edited by madhavi.e3; 10-08-2009 at 03:56 AM.

  4. #4
    Contributing Member
    Join Date
    Feb 2006
    Answers
    85

    Re: Value of a single variable (column) into data table

    Hi madhavi,
    I don know what exactle you want to achieve but in this case the error is
    DataTable.GetSheet("Global").GetParameter("RequestNumber").Value="Reqno"
    remove the double quotes("") from reqno. and it will print the value in the datatable.

    then if you want to keep the values alive after test is complete then you need to export the excel sheet. whihc is a simple command.
    Please let me know if this answers your question. or elaborate a little more on what you wanna do ...

    Cheers,
    Kunal...


  5. #5

    Re: Value of a single variable (column) into data table

    Hi,

    u can use DataTable.value("RequestNumber",1)="Reqno"


    Thanks
    Ravishankar


  6. #6
    Expert Member
    Join Date
    Apr 2008
    Answers
    1,859

    Re: Value of a single variable (column) into data table

    hi friend,

    Here is the script, just paste the script in expert view and view qtp the value will be imported to the datatable in runtime. The value imported in the runtime will be visible until the execution completes. If you need to view the value permanently you should export the values into the excel sheet.


    Systemutil.Run "iexplore.exe","www.google.com"
    Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("name:=q","html tag:=INPUT").Set "test12"
    selected=Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("name:=q","html tag:=INPUT").GetRoProperty("value")
    wait(5)
    DataTable.GetSheet ("Global").AddParameter "Sample", selected

    Thanks,
    Deepa

    Arise Awake And Stop Not Till The Goal Is Reached

  7. #7
    Junior Member
    Join Date
    Dec 2009
    Answers
    27

    Question Re: Value of a single variable (column) into data table

    Quote Originally Posted by madhavi.e3 View Post
    Hi Kunal, I have used this code i replaced the column name with RequestNumber.
    but though the test passed, it does not put the value to the data table.

    The variable to which value is assigned is reqno. and column name is RequestNumber.
    and reqno is the variable which has value REQ0043215,Now i need to display REQ0043215 in the datatable.
    so i wrote the code as

    DataTable.GetSheet("Global").GetParameter("RequestNumber").Value="Reqno"
    Can you please identify where am i going wrong?
    Hi Madhavi

    You hv to check it in run time data table.

    -kishore.gp
    9533310330


  8.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact