How do we write the value of a single variable (column) into the data table?
Question asked by visitor Deepa
How do we write the value of a single variable (column) into the data table?
Question asked by visitor Deepa
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
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.
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...
Hi,
u can use DataTable.value("RequestNumber",1)="Reqno"
Thanks
Ravishankar
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