preload

Quick questions – quick answers

Posted by Albert Gareev on Jun 22, 2010
0
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 NET and Visual Age add-ins [...] ...

How to use Dictionary object for storing Excel data ...

Posted by Albert Gareev on Jun 10, 2010
0
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 the presented code by adding unique index [...] ...

What’s the deal about QTP Actions?

Posted by Albert Gareev on May 27, 2010
1
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 written in scripting language. It [...] ...

SetACL command line examples

Posted by Albert Gareev on Apr 27, 2010
0
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 own metalanguage. [...] ...

How to use test data from a locked Excel Workbook ...

Posted by Albert Gareev on Apr 08, 2010
1
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 Excel file from QTP? Answer You can [...] ...

How to check if Excel Workbook is locked

Posted by Albert Gareev on Apr 07, 2010
0
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 ...

Processing files contained in a folder

Posted by Albert Gareev on Mar 15, 2010
0
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 patterns. Implementation 1. Retrieve total number of [...] ...

How to wrap text line (QTP, VBScript)

Posted by Albert Gareev on Feb 25, 2010
0
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 won’t fit. The function below performs wrapping of [...] ...

How to trim words inside a text line (QTP, VBScript)

Posted by Albert Gareev on Feb 22, 2010
0
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 already “trimmed” by HTML parser. [...] ...

How to find-replace empty cells (Excel, QTP, VBScript)

Posted by Albert Gareev on Jan 29, 2010
0
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 by index or by name. Set [...] ...