0

I want to capture only 1 column from excel file and put all the data in a Test box like

AAAAAA BBBBBB CCCCCC DDDDDD EEEEEE FFFFFF

and click on the save button, this data AAA,BBB etc. is in a excel sheet column I want to import it in a text box of a web page and process this text, I tried a for loop, however the data from excel is entered on same line and getting deleted when new data comes in

Following is the Code segment I am trying to write, any help appreciated:

Thanks

Browser("Web Browser").Page("Some Web page").Link("Relavent Link").Click


Datatable.Import "C:\QTP\CLIMS\ABOT\Default.xls"
RowCount = Datatable.GetSheet("Global").GetRowCount
CurrentRow = DataTable.GetSheet("Global").GetCurrentRow




runcontrols()
Function runcontrols ()
For runctrl = 1 To RowCount 
Browser("Web Browser").Page("Some Web page").WebEdit("Running Link").SetDataTable("RunControlsA", dtGlobalSheet)
DataTable.SetNextRow
Next
End Function

My excel file has 3 columns and I am trying to import from one column

Uska
  • 65
  • 1
  • 6
  • 14

2 Answers2

1
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Example.xls")
Set currentWorkSheet = objExcel.ActiveWorkbook.Worksheets(1)
intColCount = 5

For ctr = 1 To intColCount
  temp = temp + " " + currentWorkSheet.Cells(1,ctr).Value
Next

enter image description here

If I am reading your situation correctly, you have a spreadsheet as in the image and are trying to read the content of column A. In that case, the above code will come in handy. Let us know if you need any further help.

Sanjit Misra
  • 159
  • 1
  • 8
  • This statement is correct, in fact I'm adding a huge list of numbers from a single column in a textbox and then procesing the number through that web page by submitting it. Only difference is everytime I run this process, the column changes to second row (B) so is there a way I can just grab whatever is in the B column and process it. Thanks in advance – Uska Sep 24 '13 at 18:55
0

Excel Handling is essential part of QTP automation there are 4 steps to implement the same. Refer to the below post for more explnation.

http://softwaretestingperfection.blogspot.com/2013/09/excel-handling-in-qtp.html

Ashu ..
  • 1
  • 1
  • Please, try to read this http://stackoverflow.com/help/deleted-answers, to get more understanding how to **not** answer. Namely: "Answers that do not fundamentally answer the question": **barely more than a link to an external site** – Radim Köhler Sep 05 '13 at 09:36