How to Submit data from an external file to a url using QTP

Hi,
I would like to submit/load test data from an external source like a flat file or excel (multiple test cases in a file) and submit that test data to a url (application that I am testing). I need to capture the response that I get back from the application.

Can I do that using QTP ?

Thanks
Sai

Questions by sairam100   answers by sairam100

Showing Answers 1 - 2 of 2 Answers

latamindq

  • Feb 27th, 2008
 

We can submit the external file in the data table using the import , when we change the script at the values, then by using the output value u can get the result in the run-time data table.

  Was this answer useful?  Yes

''creation of new sheet using import function:-
'let say new sheet has two columns userid and password.

 v=DataTable.AddSheet ("newsheet").AddParameter ("ColumnName Time","ColumnValue 8:00" )
'msgbox"go"

'''new sheet "gupta" will be created..

DataTable.ImportSheet  "c:/name.xls","gupta","newsheet"

''here 1 is first columnname of newly imported sheet, 3 is index of newly created 'sheet:provided "gloabl", "action1" were already there.global's index is 1, action's 2 and so on.

x = datatable.Value (1,3)
''here 2 is first columnname of newly imported sheet
y = datatable.Value (2,3)
msgbox x
msgbox y

'IMPORTING data from QTP to APPLICATION...
''open your application.here i had used IE

SystemUtil.Run "C:Program FilesInternet Exploreriexplore.exe","","C:Documents and Settings...
wait (10)
Browser("Browser").Navigate  ("open ANY BROWSER")
wait(10)

Browser("Browser").Page("Gmail: Email from Google").WebEdit("Email").Set datatable(1,3)
Browser("Browser").Page("Gmail: Email from Google").WebEdit("Passwd").Set datatable (2,3)
Browser("Browser").Page("Gmail: Email from Google").WebButton("Sign in").Click

'''NOW PUT OUTPUT VALUE CHECKPOINTS for capturing values through application.

'thanks


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions