preload

Active Directory Scripting – find User Account

Posted by Albert Gareev on Mar 09, 2010
0
  Reference page: Active Directory – Sample Scripts (Excel/VBA)  Description  The function below performs 1-layer deep search of User Account object in all Organizational Units contained under parent Organizational Unit. The function can be easily modified for a recursive search if children OU hierarchy is unknown. Use objUser.Get(“distinguishedName”) to retrieve full LDAP path of found […] ...

Active Directory Scripting – modify Attributes

Posted by Albert Gareev on Mar 01, 2010
0
Reference page: Active Directory – Sample Scripts (Excel/VBA) How to modify Attributes of an Object Introduction In Microsoft Active Directory Object Classes have Attributes representing additional information about an object. It could be Firstname, Lastname – for a person, Address and Phone number both for a person and organization. Access to Attributes is performed through LDAP calls, […] ...

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 […] ...

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 […] ...

Active Directory Scripting – create Security Group

Posted by Albert Gareev on Feb 18, 2010
1
Reference page: Active Directory – Sample Scripts (Excel/VBA) How to create Security Group Description Security Group object could be created within its container object – Organizational Unit. The example below is based on the assumption that we successfully retrieved an instance of Organizational Unit. An existing User Account will also be added to the newly […] ...

Active Directory Scripting – create User Account

Posted by Albert Gareev on Feb 16, 2010
0
Reference page: Active Directory – Sample Scripts (Excel/VBA) How to create User Account Description User Account object could be created within its container object – Organizational Unit. The example below is based on the assumption that we successfully retrieved an instance of Organizational Unit. Note. You need to login as an authorized person to successfully execute […] ...

Active Directory – Sample Scripts (Excel/VBA)

Posted by Albert Gareev on Feb 14, 2010
1
Basic Active Directory Queries How to retrieve Organizational Unit How to retrieve User Account How to retrieve Security Group   Working with Active Directory Objects How to create User Account How to create Security Group How to modify Attributes of an Object Advanced Active Directory Queries Processing Security Group Membership for User Account Search for User […] ...

Active Directory Scripting – retrieve Security Group

Posted by Albert Gareev on Feb 12, 2010
0
Reference page: Active Directory – Sample Scripts (Excel/VBA) How to retrieve Security Group Description Build LDAP Query – Execute Query – Catch Errors Note. You need to login as an authorized person to successfully execute the script.  Common definitions How to retrieve Active Directory Security Group (Excel/VBA source code) Note that Security Group is an object […] ...

Active Directory Scripting – retrieve User ...

Posted by Albert Gareev on Feb 11, 2010
0
Reference page: Active Directory – Sample Scripts (Excel/VBA) How to retrieve User Account Description Build LDAP Query – Execute Query – Catch Errors Note. You need to login as an authorized person to successfully execute the script.  Common definitions How to retrieve Active Directory User Account (Excel/VBA source code) Note that we enlist directory tree nodes […] ...

Active Directory Scripting – retrieve ...

Posted by Albert Gareev on Feb 10, 2010
0
Reference page: Active Directory – Sample Scripts (Excel/VBA) How to retrieve Organizational Unit Description Build LDAP Query – Execute Query – Catch Errors Note. You need to login as an authorized person to successfully execute the script.  Common definitions How to retrieve Organizational Unit (Excel/VBA source code) Note that we enlist directory tree nodes backwars when […] ...

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 […] ...

How to find Excel worksheet by name (QTP, VBScript)

Posted by Albert Gareev on Jan 27, 2010
0
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 2. If you don’t know Excel Worksheet name exactly or not sure if it exists ...

How to check if folder exists (QTP, VBScript)

Posted by Albert Gareev on Jan 24, 2010
1
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 […] ...

How to add (create) Excel macro from QTP

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

How to enlist Excel VBA macros (QTP, VBScript)

Posted by Albert Gareev on Jan 20, 2010
1
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Retrieve Code Module object – Retrieve Code Block string – Parse the 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”, and ...

How to exchange parameters with Excel VBA function ...

Posted by Albert Gareev on Jan 15, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers 1. To pass-in parameters to an Excel VBA function A function must be public and belong to a Macro Module. QTP/VBScript source code Excel/VBA function source code 2. To retrieve parameters from an Excel VBA function You need to reserve cells on a worksheet for that purpose. […] ...

How to call Excel VBA function from QTP

Posted by Albert Gareev on Jan 14, 2010
0
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM – Open workbook – Invoke the function – Catch error – close and save the workbook. Notes. Macro (Sub or Function) must be public and belong to a Macro Module. ...

Service Functions – Excel (QTP, TestComplete, ...

Posted by Albert Gareev on Jan 12, 2010
0
In the code examples I present I often refer to routine functions. In my framework I have specialized libraries to call from.  In my blog I maintain the similar structure. Functions Excel File Worksheet compare (QTP, VBScript) How to check if Excel Workbook is locked A little automation for VBScript OOP (1) A little automation for […] ...

How to update value in XML file (QTP, VBScript)

Posted by Albert Gareev on Dec 30, 2009
0
Parent page: Service Functions – XML (QTP, VBScript)  Answers Description Open XML file – load into memory – locate target nodes – update (replace) values – save XML file (either under a new name or overwrite the original file). Search is performed by tag name (“target_node”). If you pass in a non-string parameter for .SetValue function, convert […] ...

How to count XML nodes (QTP, VBScript)

Posted by Albert Gareev on Dec 29, 2009
0
Parent page: Service Functions – XML (QTP, VBScript)  Answers 1. How to count all direct children? 2. How to count all direct children, specific name tag? 3. How to count all descendants? References Read more about XPath queries. ...

GP/QTP Automation: Execute Dexterity Macro

Posted by Albert Gareev on Dec 23, 2009
2
All related posts: Reference Page – GP/QTP Automation  Dexterity Macro Limitation and Suggested Workaround One of the major limitations identified in Dexterity Macro System is totally hard-coded data with no functionalities to read them from any external source. To overcome this issue we can dynamically generate Dexterity macro text file from a pre-built XML template. After the file […] ...

How to use loops in Dexterity Macro

Posted by Albert Gareev on Dec 21, 2009
1
All related posts: Reference Page – GP/QTP Automation  Answer According to the documentation, there are no loop operators defined in Microsoft Dynamics Great Plains Dexterity Macros. However, the macro language provides other commands to workaround the issues in the most required cases. Workarounds 1. Capture values of GUI fields (in a loop) Use DumpFieldBegin…DumpFieldEnd commands. 2. Window synchronization […] ...

How to create a unique subfolder (QTP, VBScript)

Posted by Albert Gareev on Dec 16, 2009
1
Parent page: Service Functions – System (QTP, VBScript) How to create a unique subfolder Description A subfolder is created based on the name pattern and a date-time stamp, e.g. “AccountSearch 2009-10-14 17-18-03”.  You can add extra steps and form the code as a function that returns full path of the newly created subfolder. sName – name pattern sFullPath […] ...

How to duplicate an existing file (QTP, VBScript)

Posted by Albert Gareev on Dec 15, 2009
0
Parent page: Service Functions – System (QTP, VBScript) How to duplicate an existing file (If you want to access the file but it’s locked) Description sFileName – name of the file to duplicate sNewName – name of created file (generated automatically), pass-back argument. Uses UniqueFilename function to generate a name for the duplicate file. ...

How to generate unique file name (QTP, VBScript)

Posted by Albert Gareev on Dec 14, 2009
0
Parent page: Service Functions – System (QTP, VBScript) How to generate a unique file name if the file name already exists in the given folder (That often happens, if you need to create a series of files or duplicate an existing file) Description sFileName – the “original” file name or file name template sFolderName – parent folder […] ...

Generating text file from XML template (QTP, VBScript)

Posted by Albert Gareev on Dec 09, 2009
1
Parent page: Service Functions – System (QTP, VBScript) Description If you need to generate text file with values you don’t know ahead you may do it dynamically, by utilizing the function below. Make sure you designed template first. The current logic is oriented to executable text files generation, like Dexterity Macro or OS Shell batch files. Code lines are data-driven, […] ...

GP/QTP Automation: Creating Dexterity Macro XML ...

Posted by Albert Gareev on Dec 07, 2009
1
All related posts: Reference Page – GP/QTP Automation  Dexterity Macro Limitation  One of the major limitations identified in Dexterity Macro System is totally hard-coded data with no functionalities to read them from any external source. Running scripts that always look for exactly the same account number or check balance on always the same date would provide a little […] ...

Service Functions – System (QTP, VBScript)

Posted by Albert Gareev on Dec 05, 2009
1
In the code examples I present I often refer to routine functions. In my framework I have specialized libraries to call from.  In my blog I maintain the similar structure. FileSystemObject (FSO) FileSystemObject is a primary “interface object” for the all standard  Drive/File/Folder operations: retrieving information (Drive), creating/renaming/deleting and getting/setting properties/attributes (Folders and Files), reading/writing ...

Text File Compare Report example (XML, XSL, HTML)

Posted by Albert Gareev on Dec 03, 2009
1
Root page: Service Functions – XML (QTP, VBScript) Parent page: XSL introduction and references Related post: Text File compare in “WDIFF” style (QTP, VBScript, XML, XSL) – Instructions and XSL script Sample task After line by line (and word by word) text file comparison has been performed, XML log was produced. Review the log, identify and report found issues. […] ...

XML verification example (XSL, HTML)

Posted by Albert Gareev on Dec 02, 2009
0
Root page: Service Functions – XML (QTP, VBScript) Parent page: XSL introduction and references Sample task Verify “transactions” xml file consisting of 10-1000 records. Only “debit” or “credit” record names are valid. Any other entries must be located and reported. Additionally, identify and report all debit records with debit amount greater than 50.00 Sample XML As you can […] ...
Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.