Thursday, November 24, 2011

Test Readiness Checklist...!

Before starting the actual testing, it is important to check whether the system / project / environment is ready for testing. This is called as Test Readiness Review. It is better to do it with a checklist.

Below is a sample Test Readiness Review Checklist:

1. Whether all the tests are conducted according to the Test Plan / Cases ?

2. Are all problems / defects translated into Defect Reports ?

3. Are all the Defect Reports satisfactorily resolved ?

4. Is the log of the tests conducted available?

5. Is unit testing complete in all respects?

6. Is Integration testing complete ?

7. Is all the relevant documentation baselined ?

8. Is all work products products baselined?

9. Is the test plan baselined ?

10. Does the test plan contain the strategy / procedure to conduct the system test ?

11. Are baselined test designs and test cases ready?

12. Is unit/integrated test software ready ?

13. Is the user manual ready?

14. Is the installation procedure documented ?

15. Are all the product requirements implemented?

16. Is the list of known problems available? Is there any "workaround" procedure for the known bugs ?

17. Are test environment needs met for Hardware, code, procedures, scripts, test tools etc.?

18. List of exceptions in test software and test procedures and their work around if any?

19. Is the test reporting tool is available?

20. Are the designers educated on Test reporting tool?

21. Is any standard methodology / tool used and is appropriate to the type of the project?

22. Is the criteria for regression testing defined? Has the regression testing been done accordingly?

23. Is the source code available from the client for performing regression testing complete in all respects?

24. Is the source code freezed for testing?

Test Readiness Assessment Checklist

For Assessment of:

Agency Name

Project Name

Test Phase

Date


Criteria

Yes / No / NA

a. Is the Test Plan comprehensive and complete?

b. Are the test scenarios, procedures, descriptions, and other test information comprehensive and complete?

c. Have test plan, test scenarios, procedures, descriptions, and other test information been reviewed and approved by the designated approvers?

d. Is documented methodology for the test phase feasible?

e. Is documented methodology for the test phase unambiguous?

f. Was the prerequisite test phase completed successfully?

g. If the prerequisite test phase was not completely successful, have workarounds or contingency plans for proceeding with testing been identified?

h. Was the build verification test on the release to be tested executed successfully?

i. Has the entry criteria for the test phase to be initiated been met?

j. Is the test data available?

k. Has test data been approved by the designated approvers?

l. Is the specified environment operational?

m. Have software, documentation, data, and other appropriate configuration items been placed under configuration control?

n. Are the scheduled resources available to execute and support the test phase activities?

o. Have testing resources participated in test plan reviews, training or orientation?

p. Have testing resources participated in system training or orientation?

q. Are the number and severity of remaining defects within established thresholds?

r. Are there risks associated with initiating the test phase?

s. If there are risks associated with initiating the test phase, are there plans to accept or mitigate those risks?

Wednesday, November 2, 2011

QTP - Document Object Model

Common DOM Methods & Properties

Every HTML element in a Web page is a scriptable object in the object model, with its own set of properties, methods, and events. To enable access to these objects, Internet Explorer creates a top-level document object for each HTML document it displays. When you use the .Object property on a Web page object in your test or component, you actually get a reference to this DOM object. This document object represents the entire page. From this document object, you can access the rest of the object hierarchy by using properties and collections.
Following are the most useful document properties and methods available through the Web .Object property:


Properties

activeElement Property - Retrieves the object that has the focus when the parent document has focus.
cookie Property - Sets or retrieves the string value of a cookie.
documentElement Property - Retrieves a reference to the root node of the document.
readyState Property - Retrieves a value that indicates the current state of the object.
URL Property - Sets or retrieves the URL for the current document.
URLUnencoded Property - Retrieves the URL for the document, stripped of any character encoding.


Collections

all - Returns a reference to the collection of elements contained by the object.
frames - Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window.
images - Retrieves a collection, in source order, of img objects in the document.
links - Retrieves a collection of all objects that specify the HREF property and all area objects in the document.


Methods

getElementById Method - Returns a reference to the first object with the specified value of the ID attribute.
getElementsByName Method - Retrieves a collection of objects based on the value of the NAME attribute.
getElementsByTagName Method - Retrieves a collection of objects based on the specified element name.
Note that some of these properties are also provided by QuickTest Test Objects. For example, it is possible to access the cookies set by a Web page both through the cookie property in the DOM, and through the GetCookies method provided by the Browser Test Object.
activeElement Property


Retrieves the object that has the focus when the parent document has focus.

You can get the source index of the active element (object that has focus) on the page by doing the following:
CurrentSourceInd = Browser("Browser").Page("Page").Object.activeElement.sourceIndex


Now you can query the source index of any object on the page by doing the following:




SrcIdx = Browser("Browser").Page("Page").WebEdit("q").GetROProperty("source_index")


You can then compare the two values to see if the WebEdit is the active element on the page that has focus. If the source index of the WebEdit is the same as the source index of the activeElement, then the WebEdit is the object that has focus.
cookie Property

A cookie is a small piece of information stored by the browser that applies to a Web page. Each cookie can store up to 20 name=value; pairs called crumbs, and the cookie is always returned as a string of all the cookies that apply to the page. This means that you must parse the string returned to find the values of individual cookies.

The following is an example which retrieves the value of the cookie for a specified Web page.


strCookie = Browser("Browser").Page("Page").Object.cookie
Note: You can also use the Browser Test Object's GetCookies method to retrieve cookies for a specific URL. For example:


Msgbox Browser("Yahoo").GetCookies(http://finance.yahoo.com)
documentElement Property


The documentElement property is a reference to the root node of the document. It is read-only, and has no default value. The root node of a typical HTML document is the html object.
This example uses the documentElement property to retrieve the innerHTML property of the entire document.

Msgbox Browser("Browser").Page("Page").Object.documentElement.innerHTML


readyState Property

The readyState property is a string value a string value that indicates the current state of the object.
Note that the readyState property is applicable to any DOM element. Both examples below are equally valid, and both will display the readyState of the object to which they belong


Msgbox Browser("Browser").Page("Page").Object.readyState

and

Msgbox Browser("Browser").Page("Page").Link("Link").Object.readyState

An object's state is initially set to uninitialized, and then to loading. When data loading is complete, the state of the link object passes through the loaded and interactive states to reach the complete state.



URL Property

The URL property sets or retrieves the URL for the current document. This property is valid for Page and Frame objects.

The following example displays the URL for the Web page that is currently open in the browser:

Msgbox Browser("Browser").Page("Page").Object.URL



URLUnencoded Property


The only difference between the URL property and the URLUnencoded property is that the URLUnencoded property strips the URL of any character codings (such as %20 for spaces, and so forth.)
all, frames, images, and links Collections

Return a reference to the collection of elements contained by the object.
The all collection contains all the elements in the specified object. The frames property contains objects of type window (frame). The images property contains objects of type of img (image), and the links collections contains objects of types HREF and area.
length property - Sets or retrieves the number of objects in a collection.
item method - Retrieves an object from the all collection or various other collections.
namedItem method - Retrieves an object or a collection from the specified collection.
There are additional methods available for accessing some of the collections. For example, the images collection provides the tags method, which can be used to retrieve a collection of objects with a specified tag name. For more information, see http://msdn.microsoft.com/en-us/library/ms535862(VS.85).aspx.

The following example loops through all the INPUT tags, and displays a message indicating the number of tags checked:
Set inputs = Browser("Browser").Page("Page").Object.all.tags("INPUT")
'Loop over all inputs in this collection and get the 'checked' value:
For Each inputBtn In inputs
If inputBtn.checked Then
checkedCount = checkedCount + 1
End If
Next
Msgbox checkedCount & " checkboxes are checked."
The following example displays a message indicating the number of frames in the specified Web page:
Msgbox Browser("Yahoo").Page("Yahoo!").Object.frames.length




getElementById Method


The getElementById method returns a reference to the first object with the specified value of the ID attribute.
The following example sets the value of obj to the first element in the page that has an ID of "mark":
Set obj = Browser("Browser").Page("Yahoo!").Object.getElementByID("mark")


getElementsByName and getElementsByTagName Methods


The getElementsByName and getElementsByTagName methods can be used just like getElementById except that they return a collection of objects (as opposed to getElementById, which returns only the first matching object it finds.)
For example, the following script line will display a message indicating the number of images on the page - image objects have an "IMG" tag.

Msgbox Browser("Yahoo").Page("Yahoo!").Object.getElementsByTagName ("IMG").length

QTP - Automation Object Model

Automation Object Model

'*************************************************************************************************
'*************************************************************************************************
'Open QTP and Connect to Quality Center
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp ' Declare the Application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Make changes in a test on Quality Center with version control
qtApp.TDConnection.Connect "QC URL", "DOMAIN Name", "Project Name", "User Name", "Password", False ' Connect to Quality Center



If qtApp.TDConnection.IsConnected Then ' If connection is successful
MsgBox "Succesfully connected to Quality Center"
Else
MsgBox "Cannot connect to Quality Center"
End If



qtApp.Quit ' Exit QuickTest
Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP and open New test
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp ' Declare the application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create the application object

qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

qtApp.New ' Open a new test

Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP, open an existing test and Run the Test
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp
Dim qtTest

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "C:\Tests\Test1", True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs

qtTest.Run ' Run the test

MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test

Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP, open an existing test and Run the Test with configured Run options
' And Store Run Results in Specified Folder
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp
Dim qtTest
Dim qtResultsOpt

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "C:\Tests\Test1", True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test

qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location

qtTest.Run qtResultsOpt ' Run the test

MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test

Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP, open an existing test, associate libraries and save the test
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp
Dim qtLibraries
Dim lngPosition

' Open QuickTest
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Launch QuickTest
qtApp.Visible = True ' Set QuickTest to be visible

' Open a test and get its libraries collection
qtApp.Open "C:\Tests\Test1", False, False ' Open a test
Set qtLibraries = qtApp.Test.Settings.Resources.Libraries ' Get the libraries collection object

' Add Utilities.vbs if it's not in the collection
If qtLibraries.Find("C:\Utilities.vbs") = -1 Then ' If the library cannot be found in the collection
qtLibraries.Add "C:\Utilities.vbs", 1 ' Add the library to the collection
End If

'Save the test and close QuickTest
qtApp.Test.Save ' Save the test
qtApp.Quit ' Quit QuickTest

Set qtLibraries = Nothing ' Release the test's libraries collection
Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP, open an existing test, associate Object Repositories and save the test
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp
Dim qtRepositories
Dim lngPosition

' Open QuickTest
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Launch QuickTest
qtApp.Visible = True ' Set QuickTest to be visible

' Open a test and get the "Login" action's object repositories collection
qtApp.Open "C:\Tests\Test1", False, False ' Open a test
Set qtRepositories = qtApp.Test.Actions("Login").ObjectRepositories ' Get the object repositories collection object of the "Login" action

' Add MainApp.tsr if it's not already in the collection
If qtRepositories.Find("C:\MainApp.tsr") = -1 Then ' If the repository cannot be found in the collection
qtRepositories.Add "C:\MainApp.tsr", 1 ' Add the repository to the collection
End If

'Save the test and close QuickTest
qtApp.Test.Save ' Save the test
qtApp.Quit ' Quit QuickTest

Set qtRepositories = Nothing ' Release the action's shared repositories collection
Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Open and minimize QTP Window
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest window visible
qtApp.WindowState = "Minimized" ' Maximize the QuickTest window

Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP, Open an Existing Test and Define Environment Variables
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Open the test
qtApp.Open "C:\Tests\Test1", False ' Open a test named "Test1"

' Set some environment variables
qtApp.Test.Environment.Value("Root") = "C:\"
qtApp.Test.Environment.Value("Password") = "QuickTest"
qtApp.Test.Environment.Value("Days") = 14

qtApp.Test.Save ' Save the test

qtApp.Quit ' Exit QuickTest
Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************
'Start QTP, Open an Existing Test and Get All Available Action Names From the Test
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp

' Open QuickTest
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Launch QuickTest
qtApp.Visible = True ' Set QuickTest to be visible

qtApp.Open "C:\Tests\Test1", False, False ' Open a test

oActCount=qtApp.Test.Actions.Count

For iCounter=1 to oActCount

' Get the first action in the test by index (start from 1)
MsgBox qtApp.Test.Actions(iCounter).Name

Next

'Close QuickTest
qtApp.Quit ' Quit QuickTest

Set qtApp = Nothing ' Release the Application object

'*************************************************************************************************
'*************************************************************************************************
'Start QTP with specified views
'*************************************************************************************************
'*************************************************************************************************
Dim qtApp
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest

qtApp.ActivateView "ExpertView" ' Display the Expert View
qtApp.ShowPaneScreen "ActiveScreen", True ' Display the Active Screen pane
qtApp.ShowPaneScreen "DataTable", False ' Hide the Data Table pane
qtApp.ShowPaneScreen "DebugViewer", True ' Display the Debug Viewer pane

qtApp.WindowState = "Maximized" ' Maximize the QuickTest window
qtApp.Visible = True ' Make the QuickTest window visible

Set qtApp = Nothing ' Release the Application object
'*************************************************************************************************
'*************************************************************************************************

QTP - Excel System Object

Create excel file and enter some data save it
view plainprint?
'###############################################
'Create excel file and enter some data save it
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Add New Workbook
Set workbooks=excel.Workbooks.Add()

'Set the value in First row first column
excel.Cells(1,1).value="testing"

'Save Work Book
workbooks.saveas"D:\excel.xls"

'Close Work Book
workbooks.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set workbooks=Nothing
Set excel=Nothing
Reading Values from a Specific excel Sheet
view plainprint?
'###############################################
' Reading Values from a Specific excel Sheet
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open the Excel File
Set workbook=excel.Workbooks.Open("D:\excel.xls")

'Get the Control on Specific Sheet
Set worksheet1=excel.Worksheets.Item("Sheet1")

' Display the Values
Msgbox worksheet1.cells(1,1).value

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set worksheet1=Nothing
Set workbook=Nothing
Set excel=Nothing
Deleting Rows from Excel Sheet
view plainprint?
'###############################################
' Deleting Rows from Excel Sheet
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open the Excel File
Set workbook=excel.Workbooks.Open("D:\excel.xls")

'Get the Control on Specific Sheet
Set worksheet1=excel.Worksheets.Item("Sheet1")

'Delete Row1
worksheet1.Rows("1:1").delete

'Save Excel
workbook.SaveAs("D:\excel.xls")

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set worksheet1=Nothing
Set workbook=Nothing
Set excel=Nothing
Add and Delete ExcelSheet
view plainprint?
'###############################################
' Add and Delete ExcelSheet
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open Existing Excel File
Set workbook=excel.Workbooks.Open("D:\excel.xls")

'Add New Sheet
Set newsheet=workbook.sheets.Add

'Assign a Name
newsheet.name="raj"

'Delete Sheet
Set delsheet=workbook.Sheets("raj")
delsheet.delete

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set newsheet=Nothing
Set delsheet=Nothing
Set workbook=Nothing
Set excel=Nothing
Copy an Excel Sheet of one Excel File to another Excel File
view plainprint?
'###############################################
' Copy an Excel Sheet of one Excel File to another Excel File
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open First Excel File
Set workbook1=excel.Workbooks.Open("D:\excel1.xls")

'Open Second Excel File
Set workbook2=excel.Workbooks.Open("D:\excel2.xls")

'Copy data from first excel file sheet
workbook1.Worksheets("raj").usedrange.copy

'Paste Data to Second Excel File Sheet
workbook2.Worksheets("Sheet1").pastespecial

'Save Workbooks
workbook1.Save
workbook2.Save

'Close Workbooks
workbook1.Close
workbook2.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set workbook1=Nothing
Set workbook2=Nothing
Set excel=Nothing
Comapre Two Excel Sheets Cell By Cell for a specific Range
view plainprint?
'###############################################
' Comapre Two Excel Sheets Cell By Cell for a specific Range
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open Excel File
Set workbook=excel.Workbooks.Open("D:\excel.xls")

'Get Control on First Sheet
Set sheet1=excel.Worksheets.Item("Sheet1")

'Get Control on Second Sheet
Set sheet2=excel.Worksheets.Item("Sheet2")

'Give the specific range for Comparision
CompareRangeStartRow=1
NoofRows2Compare=4
CompareRangeStartColumn=1
NoofColumns2Compare=4

'Loop through Rows
For r=CompareRangeStartRow to(CompareRangeStartRow+(NoofRows2Compare-1))

'Loop through columns
For c=CompareRangeStartColumn to(CompareRangeStartColumn+(NoofColumns2Compare-1))

'Get Value from the First Sheet
value1=Trim(sheet1.cells(r,c))
'Get Value from the Second Sheet
value2=Trim(sheet2.cells(r,c))

'Compare Values
If value1<>value2 Then

' If Values are not matched make the text with Red color
sheet2.cells(r,c).font.color=vbred

End If

Next

Next

'Save workbook
workbook.Save

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set sheet1=Nothing
Set sheet2=Nothing
Set workbook=Nothing
Set excel=Nothing
Reading complete data from excel file
view plainprint?
'###############################################
' Reading complete data from excel file
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open Excel File
Set workbook=excel.Workbooks.Open("D:\excel.xls")

'Get Control on Sheet
Set worksheet=excel.Worksheets.Item("raj")

'Get the count of used columns
ColumnCount=worksheet.usedrange.columns.count

'Get the count of used Rows
RowCount=worksheet.usedrange.rows.count

'Get the Starting used Row and column
top=worksheet.usedrange.row
lft=worksheet.usedrange.column

'Get cell object to get the values cell by cell
Set cells=worksheet.cells

'Loop through Rows
For row=top to (RowCount-1)
rdata=""
'Loop through Columns
For col=lft to ColumnCount-1
'Get Cell Value
word=cells(row,col).value

'concatenate all row cell values into one variable
rdata=rdata&vbtab&word
Next

'Print complete Row Cell Values
print rdata
Next

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set worksheet=Nothing
Set workbook=Nothing
Set excel=Nothing
Read complete data from an Excel Sheet content
view plainprint?
'###############################################
' Read complete data from an Excel Sheet content
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Open Excel File
Set workbook=excel.Workbooks.open("D:\excel.xlsx")

'Get Control on Sheet
Set worksheet=excel.Worksheets.Item("Sheet1")

'Get Used Row and Column Count
rc=worksheet.usedrange.rows.count
cc=worksheet.usedrange.columns.count

'Loop through Rows
For Row=1 to rc
'Loop through Columns
For Column=1 to cc
'Get Cell Data
RowData=RowData&worksheet.cells(Row,Column)&vbtab
Next
RowData=RowData&vbcrlf
Next

'Display complete Data
msgbox RowData

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set worksheet=Nothing
Set workbook=Nothing
Set excel=Nothing
Assign Colours to Excel Sheet Cells, Rows
view plainprint?
'###############################################
' Assign Colours to Excel Sheet Cells, Rows
'###############################################

'Create Excel Object
Set excel=createobject("excel.application")

'Make it Visible
excel.Visible=True

'Add a New work book
Set workbook=excel.workbooks.add()

'Get the Excel Sheet
Set worksheet=excel.worksheets(1)

'Coloring Excell Sheet Rows
Set objrange=excel.activecell.entirerow
objrange.cells.interior.colorindex=37

'Coloring Excell Sheet Cell
worksheet.cells(2,1).interior.colorindex=36

'Save Excel
workbook.SaveAs("D:\excel.xls")

'Close Work Book
workbook.Close

'Quit from Excel Application
excel.Quit

'Release Variables
Set objrange=Nothing
Set worksheet=Nothing
Set workbook=Nothing
Set excel=Nothing