mad4test

Tuesday, May 15, 2012

Custom COM for Automation

In Software Automation Testing, the biggest challenge which people face is nothing other then Maintenance and Re-usability,
A true re-usability can only be achieved if  you have the right framework developed which supports upgrades and enhancements without making any changes in the core architecture of the framework, and this can only be achieved by developing a 100% generic framework, I know you will now say 100% generic framework is a Myth, well it is NOT, it depends how you are developing your framework, developing a Scope Based Hybrid Framework also know as functional decomposition framework is all what you need.

Nevertheless, as per the title today we are not really discussing about the framework, but a Super Generic Component Building Approach which will going to be the part of your framework.

This COM (Component object Model) has been developed using VB.Net framework 3.5 and upgraded to 4.0 now.

Using the component
Dim MYCOM 
Set MYCOM = CreateObject("MyCOMClass.Application")






Some discussion thread around this reference at SQAForums.com

1) Thread : My Beautiful Framework 
2) Thread : DataTable Export Failed



I hope this helps, Happy Programming :) !


Note : this component is not QTP depenedent and can be used directly with vbscript/.net for developing softwares and useful for admins to develop scripts

Type Name
Type Description
Email
MYCOM.Email.Send
This function allows the user to send an email, this does not have any dependency on outlook. User can send multiple files as attachment as well. The email can also be sent in an html formatted body content.
Excel
MYCOM.Excel.ColumnExist
This function checks if the specified column exists in the given excel sheet
MYCOM.Excel.ConvertDelimitedDataFileToExcelFile
This function converts the delimited data file into an excel file
MYCOM.Excel.Dispose
This functions performs garbage collection of the excel object. This is used when sometimes excel object is not automatically released
MYCOM.Excel.ExcelCCPD
This function can be used to perform cut, copy, paste operation on a excel sheet content
MYCOM.Excel.GetAllSheetNames
This function returns the names of all the sheets in the given excel file.
Quality Center
MYCOM.Excel.ToHtml
This function converts the content of the excel sheet in a html string format
MYCOM.QualityCenter.connect
This function allows to connect to quality center
MYCOM.QualityCenter.DownloadAllAttachments(
This function downloads all attachments from given path in quality center to local path
MYCOM.QualityCenter.DownloadAttachment
This function downloads only the fully specified attachment from quality center to local machine path
Unix
Set objFTP = MYCOM.Unix.Ftp
This allows to create an ftp connection
objFTP.CurrentDirectory
This function gives the current directory of the ftp connection
objFTP.Download
This function downloads a file from FTP location to local path
objFTP.FtpCreateDirectory
This function creates a directory in the ftp path
objFTP.FtpDelete
This function deletes a file from the ftp location
objFTP.FtpDeleteDirectory
This function deletes a directory from the ftp location
objFTP.FtpFileExists
This function checks if the file in the ftp location exists
objFTP.FtpRename
This function renames a file in the ftp location
objFTP.GetFileSize
This function gets the size of the file located in the ftp folder
objFTP.ListDirectory
This function lists all the directory names in the specified ftp folder
objFTP.Upload
This function uploads a given file from local machine to ftp folder
MYCOM.Unix.Scp
This function creates a SCP connection
MYCOM.Unix.Ssh
This function creates a SSH connection
MYCOM.Unix.SshEx
This function creates a SSHEX connection
Utility, FileSystem, Array, Lists, Zip
MYCOM.Utils.Array.ChangeCaseOfElement
This function changes the case of each array element to upper or lower based on the input specified
MYCOM.Utils.Array.Compare
This function compares two arrays
MYCOM.Utils.Array.Contains
This function checks if the specified element exists in an array
MYCOM.Utils.Array.Distinct
This function returns only the distinct element from the array.Removes duplicate elements.
MYCOM.Utils.Array.IndexOf
This function returns the index of the specified item in the array
MYCOM.Utils.Array.Remove
This function removes the specified element from the array
MYCOM.Utils.Array.RemoveAt
This function removes the array element located at a specified index
MYCOM.Utils.Array.Reverse
This function reverse the elements of the array.
MYCOM.Utils.Array.Sort
This function sorts the array
MYCOM.Utils.Array.TrimEachElement
This function Trims each element of the array
MYCOM.Utils.Dates.AddDays
This function adds the specfied number of days to the given date
MYCOM.Utils.Dates.AddMonths
This function adds the specfied number of months  to the given date
MYCOM.Utils.Dates.AddYears
This function adds the specfied number of years  to the given date
MYCOM.Utils.Dates.Format
This function formats the given input date to given format like dd/mm/yy etc
MYCOM.Utils.Dates.GetLatestWorkingDay
This function returns the latest working day. If today is weekend, then it will return Mondays date.
MYCOM.Utils.Dates.GetNextWorkingDay
This function returns the next working day.
MYCOM.Utils.directory.Copy
Function name is self explanatory
MYCOM.Utils.directory.Create
Function name is self explanatory
MYCOM.Utils.directory.Delete
Function name is self explanatory
MYCOM.Utils.directory.Exists
Function name is self explanatory
MYCOM.Utils.directory.GetDirectoryList
Function name is self explanatory
MYCOM.Utils.directory.Move
Function name is self explanatory
MYCOM.Utils.File.AppendAllText
Function name is self explanatory
MYCOM.Utils.File.CompareTextFile
Function name is self explanatory
MYCOM.Utils.File.Copy
Function name is self explanatory
MYCOM.Utils.File.Delete
Function name is self explanatory
MYCOM.Utils.File.Exist
Function name is self explanatory
MYCOM.Utils.File.GetExtension
Function name is self explanatory
MYCOM.Utils.File.GetFileList
Function name is self explanatory
MYCOM.Utils.File.GetMD5Checksum
Function name is self explanatory
MYCOM.Utils.File.Move
Function name is self explanatory
MYCOM.Utils.File.ReadAllText
Function name is self explanatory
MYCOM.Utils.File.WriteAllText
Function name is self explanatory
MYCOM.Utils.List.Add
Function name is self explanatory
MYCOM.Utils.List.AddRange
Function name is self explanatory
MYCOM.Utils.List.Clear
Function name is self explanatory
MYCOM.Utils.List.Contains
Function name is self explanatory
MYCOM.Utils.List.CopyTo
Function name is self explanatory
MYCOM.Utils.List.Count
Function name is self explanatory
MYCOM.Utils.List.Insert
Function name is self explanatory
MYCOM.Utils.List.Item
Function name is self explanatory
MYCOM.Utils.List.Remove
Function name is self explanatory
MYCOM.Utils.List.RemoveAt
Function name is self explanatory
MYCOM.Utils.List.ToArray
Function name is self explanatory
MYCOM.Utils.List.TrimToSize
Function name is self explanatory
MYCOM.Utils.My.ComputerName
Function name is self explanatory
MYCOM.Utils.My.DisplayName
Function name is self explanatory
MYCOM.Utils.My.UserName
Function name is self explanatory
MYCOM.Utils.Network.DownloadFile
Function name is self explanatory
MYCOM.Utils.Network.UploadFile
Function name is self explanatory
MYCOM.Utils.String.Decrypt
Function name is self explanatory
MYCOM.Utils.String.DQ
Function name is self explanatory
MYCOM.Utils.String.Encrypt
Function name is self explanatory
MYCOM.Utils.String.ReplaceGarbageCharWithSpace
Function name is self explanatory
MYCOM.Utils.String.SQ
Function name is self explanatory
MYCOM.Utils.UnZip
Function name is self explanatory
MYCOM.Utils.Zip
Function name is self explanatory
MYCOM.Utils.XML.DictionaryToXML
Function name is self explanatory
MYCOM.Utils.XML.XMLToDictionary
Function name is self explanatory
Data table, data manipulation In-memory
Set objTableGroup = MYCOM.TableGroup.Create
Function name is self explanatory
objTableGroup.CreateTable
Function name is self explanatory
objTableGroup.Export
Function name is self explanatory
objTableGroup.GetCommonColumnNames
Function name is self explanatory
objTableGroup.GetTableCount
Function name is self explanatory
objTableGroup.GetTableNames
Function name is self explanatory
objTableGroup.GetUncommonColumnNames
Function name is self explanatory
objTableGroup.ImportCSVFile
Function name is self explanatory
objTableGroup.ImportDelimitedFile
Function name is self explanatory
objTableGroup.ImportExcelFile
Function name is self explanatory
objTableGroup.ImportExcelSheet
Function name is self explanatory
objTableGroup.ImportXMLFile
Function name is self explanatory
objTableGroup.RemoveAllTables
Function name is self explanatory
objTableGroup.RemoveCommonBlankColumns
Function name is self explanatory
objTableGroup.RemoveTable
Function name is self explanatory
objTableGroup.TableExist
Function name is self explanatory
Set objTable = objTableGroup.Table
Function name is self explanatory
objTable.Columns
Function name is self explanatory
objTable.DataTable
Function name is self explanatory
objTable.Export
Function name is self explanatory
objTable.ReadTableIntoDictionary
Function name is self explanatory
objTable.Rows
Function name is self explanatory
objTable.Columns.Add
Function name is self explanatory
objTable.Columns.AddRange
Function name is self explanatory
objTable.Columns.ArrangeAlphabetically
Function name is self explanatory
objTable.Columns.Count
Function name is self explanatory
objTable.Columns.Exist
Function name is self explanatory
objTable.Columns.ImportArray
Function name is self explanatory
objTable.Columns.ListNames
Function name is self explanatory
objTable.Columns.Remove
Function name is self explanatory
objTable.Columns.ToArrayList
Function name is self explanatory
objTable.Rows.Add
Function name is self explanatory
objTable.Rows.Count
Function name is self explanatory
objTable.Rows.Cursor
Function name is self explanatory
objTable.Rows.GetDuplicateInTable
Function name is self explanatory
objTable.Rows.ReadCell
Function name is self explanatory
objTable.Rows.RemoveDuplicate
Function name is self explanatory
objTable.Rows.ToArray
Function name is self explanatory
objTable.Rows.ToDictionary
Function name is self explanatory
objTable.Rows.WriteCell
Function name is self explanatory
objTable.Rows.Cursor.CurrentRow
Function name is self explanatory
objTable.Rows.Cursor.MoveFirst
Function name is self explanatory
objTable.Rows.Cursor.MoveLast
Function name is self explanatory
objTable.Rows.Cursor.MoveNext
Function name is self explanatory
objTable.Rows.Cursor.MovePrevious
Function name is self explanatory
objTable.Rows.Cursor.MoveTo
Function name is self explanatory
objTable.Rows.Cursor.MoveToNew
Function name is self explanatory
Data Compare functiontions
MYCOM.Compare.DataTable
Function name is self explanatory
MYCOM.Compare.Excel
Function name is self explanatory
MYCOM.Compare.TextFile
Function name is self explanatory
MYCOM.Compare.XML
Function name is self explanatory
MYCOM.Database.ReadExcelSheetIntoDataTableUsingOLEDB
Function name is self explanatory



StatCounter