Posted by Albert Gareev on Apr 17, 2012
Parent page: Using GUI Forms in TestComplete Even though automation scripts are intended to drive the application under test there are cases when communication with tester is required. With TestComplete, we have a vast arsenal of predefined GUI controls for that (and those, acquainted with Delphi, will be pleasantly surprised by the way it’s organized). [...] ...
Posted by Albert Gareev on Apr 16, 2012
Parent page: Using GUI Forms in TestComplete Even though automation scripts are intended to drive the application under test there are cases when communication with tester is required. With TestComplete, we have a vast arsenal of predefined GUI controls for that (and those, acquainted with Delphi, will be pleasantly surprised by the way it’s organized). [...] ...
Posted by Albert Gareev on Apr 10, 2012
Parent page: Using GUI Forms in TestComplete Even though automation scripts are intended to drive the application under test there are cases when communication with tester is required. With TestComplete, we have a vast arsenal of predefined GUI controls for that (and those, acquainted with Delphi, will be pleasantly surprised by the way it’s organized). [...] ...
Posted by Albert Gareev on Apr 09, 2012
Parent page: Using GUI Forms in TestComplete Even though automation scripts are intended to drive the application under test there are cases when communication with tester is required. With TestComplete, we have a vast arsenal of predefined GUI controls for that (and those, acquainted with Delphi, will be pleasantly surprised by the way it’s organized). [...] ...
Posted by Albert Gareev on Nov 24, 2011
Description Get object reference. Get total number of items in the list. Generate an index within the given range. Select item by index. Implementation Dim objPage, objList Dim boolRC Dim intItemsCount, intRndItem 'Assumptions: ' "Google Advanced Search" page is up ' "Results per page" WebList exists and enabled 'Get page object Set objPage = Browser("CreationTime:=0").Page("title:=Google Advanced ...
Posted by Albert Gareev on Jul 26, 2011
Reference page: Service Functions – System (QTP, VBScript) Description Check folder exists – check folder has files. Iterate through collection of files and keep reference of the most recently modified file (its DateLastModified property is always the highest number). The remaining reference is the one that you need. In case of errors the function returns [...] ...
Posted by Albert Gareev on Oct 26, 2010
Parent page: Service Functions – System (QTP, VBScript) Question I need to modify text file template (add a few lines) and “Save as”. Answer One of the typical challenges that people face while trying to automate work tasks, is “procedure – result” confusion. Here, the end result* is confused with a way** to do the [...] ...
Posted by Albert Gareev on Jun 22, 2010
Quick Answers Quick answers to questions arrived into my blog recently. How to load GUI map in QTP during run-time? Use methods of RepositoriesCollection object: Find / Add / Remove. See sample code, read investigation results. What’s the name of add-in for MS Dynamics Great Plains automation? There is no specific add-in. You would need Dot [...] ...
Posted by Albert Gareev on Jun 10, 2010
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM - Open workbook - Open worksheet – map cell values to column names. Notes. Heading and trailing space characters are removed To make mapping not case sensitive index is brought to lower case If your spreadsheet allows column name duplication you need to enhance [...] ...
Posted by Albert Gareev on May 27, 2010
QTP Action at a glance “Happy Path” Test Flow The screenprint above demonstrates sample “Test” Flow designed using QTP Actions. “Happy Path” testing, or conformance testing, or checking can be characterized by 2 attributes: it is scripted, and it ignores everything that is out of scope. Scripted here does not mean a program [...] ...
Posted by Albert Gareev on Apr 27, 2010
I found SetACL tool very handy. In addition to implementation of security settings in batch files (that’s what it was created for), I quite successfully used it in automation of infrastructure maintenance and testing jobs that occure daily and even hourly. As any command line tool, powerful but simple, it requires instructions written in its [...] ...
Posted by Albert Gareev on Apr 08, 2010
Parent page: Service Functions – Excel (QTP, VBScript) Question The question was asked here. How can I get data from Excel spreadsheet if it is accidentally open? It ruins whole batch execution. While opening manually I can go “read-only” and still access it. Is there any way to read data from an open and locked [...] ...
Posted by Albert Gareev on Apr 07, 2010
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM - Open workbook - Check property. Public Function ReadOnlyWorkbook(ByVal sFileName) Dim objXLBook, objXLHandle Dim FSO, boolRC Set FSO = CreateObject("Scripting.FileSystemObject") boolRC = FSO.FileExists(sFileName) Set FSO = Nothing If Not boolRC Then ReadOnlyWorkbook = FALSE Exit Function End If ' Set ...
Posted by Albert Gareev on Mar 15, 2010
Reference page: Service Functions – System (QTP, VBScript) Question The question was asked here. I need to check number of text files in the folder but i dont know names Answer Checking what number of files is contained in a folder is simple. More challenging tasks would be processing files based on type or name [...] ...
Posted by Albert Gareev on Feb 25, 2010
Parent page: Service Functions – String (QTP, VBScript) Question The question was asked here. Hi Albert! Can you email me a QTP function that wraps line of text without breaking words? Thank you! Answer Proper text alignment is important. The whole layout of CSS block or HTML table could be broken if a text line [...] ...
Posted by Albert Gareev on Feb 22, 2010
Parent page: Service Functions – String (QTP, VBScript) Question The question was asked here. What QTP function i can use to trim inside string? For e.g. “text text text text” – i want only 1 space between. Answer I believe the sample string provided in the question originally contained multiple space characters inside but was [...] ...
Posted by Albert Gareev on Jan 29, 2010
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM - Open workbook - Open worksheet – Loop through data range – close and save the workbook. Note. In the example below script finds empty cells and assigns zero to them. Make sure you targeted the worksheet that you need. You can find it [...] ...
Posted by Albert Gareev on Jan 27, 2010
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM - Open workbook - Loop through worksheets – close and save the workbook. 1. If you know Excel Worksheet name and pretty sure it exists Set XLHandle = CreateObject("Excel.Application") XLHandle.DisplayAlerts = False Set XLBook = XLHandle.WorkBooks.Open("c:\temp\1.xls") On Error Resume Next Set objWorksheet ...
Posted by Albert Gareev on Jan 24, 2010
Parent page: Service Functions – System (QTP, VBScript) Use FileSystemObject.FolderExists method. Argument should be a full path string. When to use it? Always before trying to access the folder (delete, rename, or read from) or create files in it. Note. Always release the object you created when you no longer need it. If you don’t do [...] ...
Posted by Albert Gareev on Jan 21, 2010
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM - Open workbook - Retrieve Code Module object - Add new macro string - close and save the workbook. Notes. For this example let’s assume our target Workbook is stored as “C:\Temp\1.xls”, and our target Code Module is named “Module1″. QTP/VBScript source code Set XLHandle = ...