Geeks Talk

Prepare for your Next Interview




How to do populate values in Quality Center from values in Excel?

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 ...


Go Back   Geeks Talk > Software Testing > Quality Center

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-07-2008
Junior Member
 
Join Date: Jan 2008
Location: atlanta
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
snabors is on a distinguished road
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
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-08-2008
Expert Member
 
Join Date: Oct 2007
Location: Mumbai
Posts: 347
Thanks: 4
Thanked 54 Times in 44 Posts
bizzzzzare is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Software Testing > Quality Center


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 10:28 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved