KabInfo.Net                                     

 

Q. How to access the HTML tags directly?

A.  QuickTest provides direct access to the browser's Document Object Model (DOM) through which you may access the HTML tags directly. Access to the DOM is done using the .Object notation. You can find more information about the DOM on the Microsoft Web Workshop web site.

The test below demonstrates how to iterate over all the tags in the page. The test then outputs the inner-text of the tags (the text contained between the tags) to the report using the Reporter object.

' We need the on error because not all the elements have inner-text
On Error Resume Next
Set Doc = Browser("CNN Interactive").Page("CNN Interactive").Object
' Loop through all the objects in the page
For Each Element In Doc.all
     TagName   = Element.TagName    ' Get the tag name
     InnerText = Element.innerText  ' Get the inner text

     ' Write the information to the report
     Reporter.ReportEvent 0, TagName, InnerText
Next

Q. Where can I find a web page's cookie?
A. The cookie used by the browser may by accessed through the browser's Document Object Model (DOM). The following example returns the cookie collection from the browser. You can find more information about the DOM on the Microsoft Web Workshop web site.

Browser("Flight reservations").Page("Flight reservations").Object.Cookie

Q. How to change the template test which is used by Quality Center to create new tests?
A. When creating a new test from Quality Center, the test is based on a template test which is located under "bin/TD2000" directory under the "TestDirector Plugins" installation.

You can replace this test to contain the test template that you wish to be used.

Note that if you change the test to use a QuickTest Professional 6.0 (or later) template test then this test can not be opened in Astra LoadTest 5.x

 Q. How to change the manual template test which is used by Quality Center when converting manual tests to QuickTest test?
A.  When you have a manual test defined in Quality Center and you want to create from it an automatic test, you can control the way this automatic test will be created.

You can edit the ManualTemplate.txt file located under "bin/TD2000" directory under "TestDirector Plugins" installation to contain the steps which you want to be generated in the QTP test for each manual step.

Q. How to close QuickTest after <n> runs when running from Quality Center?
A. When running multiple QuickTest Professional tests from Quality Center you can specify that you want to close QTP after specific amount of tests which are executed.

To do so, you should add to the end of the mic.ini file (located under the bin directory of QTP installation) the following lines:

[RemoteAgent]

CloseToolAfterRuns=<number>