Prepare for your Next Interview
This is a discussion on How to do populate values in Quality Center from values in Excel? within the Quality Center forums, part of the Software Testing category; How to do populate values in Quality Center from values in Excel? I am trying to populate a field in Quality Center from a field in an Excel spreadsheet based ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
How to do populate values in Quality Center from values in Excel?
How to do populate values in Quality Center from values in Excel?
I am trying to populate a field in Quality Center from a field in an Excel spreadsheet based off what is entered in another field in Quality Center. My code doesnt populate anything and doesnt give me any errors. Can someone please help me? Here is the code. The code is Sub Defects_Bug_FieldChange(FieldName) Dim objExcel Dim excelPath Dim cells Dim row Dim sheet Dim word Dim objWorkbook excelPath = "C:\Test\Quality Center\QATOwnersTest.xls" objExcel.Workbooks.open excelPath, false, true Set objExcel = CreateObject("Excel.Application") Set Sheet = objExcel.ActiveWorkBook.Worksheet(1) IF (Bug_Fields("BG_USER_06").Value = "ABC" AND Bug_Fields("BG_USER_04").Value = "EFG") Then For row = 1 To 3 IF Bug_Fields ("BG_USER_11").Value = Sheet.Cells(Row, 1) Then Bug_Fields ("BG_USER_12").Value = Sheet.Cells(Row, 2) ![]() End IF Next End If objExcel.Quit |
| Sponsored Links |
|
|||
|
Re: How to do populate values in Quality Center from values in Excel?
Hi snabors,
Based on your attached code, the code seems to be in place for checking whether BG_USER_11 field value equals the retrieved value from Row, col of excel and then populating BG_USER_12 with excel value. I would suggest try debugging your code in the following manner. Also I see that "objExcel.Workbooks.open excelPath, false, true " line to be included prior to creating Excel Object. Is that so ? excelPath = "C:\Test\Quality Center\QATOwnersTest.xls" Set objExcel = CreateObject("Excel.Application") objExcel.Workbooks.open excelPath, false, true Set Sheet = objExcel.ActiveWorkBook.Worksheet(1) IF (Bug_Fields("BG_USER_06").Value = "ABC" AND Bug_Fields("BG_USER_04").Value = "EFG") Then msgbox "Values Matched" For row = 1 To 3 set OutputValue = Sheet.Cells(Row, 1) msgbox OutputValue If Bug_Fields ("BG_USER_11").Value = OutputValue then Bug_Fields ("BG_USER_12").Value = Sheet.Cells(Row, 2) Msgbox "BG_USER_12 value set". end if next End if Also try to check whether the code actually enters the If conditions or not. Incase the condition never returns true then I guess your code will never do anything. Try including msgbox when you enter If Loop to reflect whether code has been reached or not. Cheers....
__________________
Regards, V.Umesh Krishnan QA Consultant |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| quality center help | sonyg | Quality Center | 4 | 04-14-2008 06:56 AM |
| Datatable: Creation, Writing and Reading the values from Excel Sheet | ravisuriya | QTP | 3 | 02-29-2008 11:41 AM |
| How do QTP access the cell values in an excel file located in QC. | Faisalalik | QTP | 1 | 02-25-2008 10:33 PM |
| Quality center & Performance center in Load runner. | balajip82 | LoadRunner | 1 | 02-19-2008 05:46 AM |
| Read excel values into script without opening excel | nemishdmehta | QTP | 1 | 02-11-2008 07:19 AM |