Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Filters parent XML object by removing child XML nodes not matching specified attribute regex value. Implementation Unit Tests ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Filters parent XML object by removing child XML nodes not matching specified attribute value. Implementation Unit Tests ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Returns child XML node with specified attribute matching specified regex. Implementation Unit Tests ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Append all child elements from the list (including their attributes, comments, text nodes) to XML node. Implementation Test Code ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Returns text value of node’s child attribute specified by name. Valid arguments: an XML element node (NODE_ELEMENT type), name of the attribute. If XML node is not defined, returns empty string. Uses private function p_GetXMLElementAttrText, defined within the library (see parent page). Implementation ...
Parent page: Service Functions – String (QTP, VBScript) Description Get token string from the source string. Position is relative, defined by another token-keyword and a number. Implementation ...
Parent page: Service Functions – String (QTP, VBScript) Description Get token string from the source string. Position is absolute, defined by number. Implementation ...
A few simple Excel macros I use for automatic data maintenance. Date Macro Current date/time =NOW() 9/7/2011 17:57 Date formatted as text =TEXT(NOW(),”mm/dd/yyyy”) 09/07/2011 Future date (5 days from today) =TEXT(NOW()+5,”mm/dd/yyyy”) 09/12/2011 A year 180 days before today =TEXT(YEAR(NOW()-180), “00”) 2011 A month 58 days from today =TEXT(MONTH(NOW()+58), “00”) 11 Year, formatted ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Copy all child elements (and attributes, comments, text nodes) from one XML node to another. Implementation Test Code ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Move all child elements (and attributes, comments, text nodes) from one XML node to another. Implementation Test Code ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Locate XML node depth within the hierarchy. Valid argument: an XML element node (NODE_ELEMENT type). Implementation ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Description Create XML DOM object by loading source XML from string. If the string is empty or source XML is invalid returns Nothing. Implementation Test Code ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Service Functions – Dictionary (QTP, TestComplete, VBScript) Description For each occurrence of XML node perform conversion to Dictionary, and store all records in indexed Dictionary object. Implementation ...
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript) Service Functions – Dictionary (QTP, TestComplete, VBScript) Description Create Dictionary object and populate with data (only direct content - text, comments, CData, and attributes) taken from XML node. Naming convention: @attr_name for attributes; #text_index for text nodes; #comment_index for comment nodes; #cdata_index for CData Section nodes. […] ...
Parent page: Generating Test Reports Today I put all examples together. Here’s our XML record simulating log data of a test session. XML Source The following line <?xml-stylesheet type=”text/xsl” href=”.\LogView4.xsl”?> instructs the web browser to use XSL script for visualization of XML data. Web-page Report And here’s the source code of the script XSL Source […] ...
Parent page: Generating Test Reports Let’s now take the examples from the previous post, and add more style. Here’s our XML record simulating log data of a test session. XML Source Did you notice the following line? <?xml-stylesheet type=”text/xsl” href=”.\LogView3.xsl”?> This is how we instruct the web browser to use XSL script for visualization of XML data. […] ...
Parent page: Generating Test Reports Today I continue with more complex examples using previously demonstrated XSL parsing nodes grouped into sub-templates. Here’s our XML record simulating log data of a test session. XML Source Note that the structure of XML file is not identical to the previous examples. It has more complexities and dependencies that need […] ...
Parent page: Generating Test Reports Today I present XML Tree to HTML Table transformation example. Here’s our XML record simulating logged test steps. XML Source Did you notice the following line? <?xml-stylesheet type=”text/xsl” href=”.\Tree2Table.xsl”?> This is how we instruct the web browser to use XSL script for visualization of XML data. Web-page Report And here’s […] ...
Parent page: Generating Test Reports Today I present example on dynamically building HTML nodes, with XSL, and from XML data. Here’s our XML record simulating log data of a test session. XML Source Did you notice the following line? <?xml-stylesheet type=”text/xsl” href=”.\LogView1.xsl”?> This is how we instruct the web browser to use XSL script for […] ...
Parent page: Generating Test Reports Today I present example of an HTML Table populated with XML data. Here’s our XML record simulating stats data of a test session. XML Source Did you notice the following line? <?xml-stylesheet type=”text/xsl” href=”.\StatsTable.xsl”?> This is how we instruct the web browser to use XSL script for visualization of XML […] ...
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 […] ...
Parent page: Service Functions – String (QTP, VBScript) Description Based on the maximum allowed length of the string (strMsgText) insert space characters. Implementation ...
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 […] ...
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 […] ...
Parent page: Service Functions – Excel (QTP, VBScript) Answers Description Connect to Excel through COM - Open workbook - Check property. ...
Parent page: Service Functions – String (QTP, VBScript) Question The question was asked here. Hi Author! 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 […] ...
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 […] ...
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 […] ...
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 ...
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 ...