ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Advanced Web Issues[faq]

Advanced Web Issues[faq]

原创 Linux操作系统 作者:ipqiaojj 时间:2009-03-17 15:37:17 0 删除 编辑

Advanced Web Issues

  • How does QuickTest handle cookies?
  • Server side connections, such as CGI scripts, can use cookies both to store and retrieve information on the client side of the connection.

    QuickTest stores cookies in the memory for each user, and the browser handles them as it normally would.

  • Where can I find a Web page's cookie?
  • The cookie used by the Internet Explorer browser can be accessed through the browser's Document Object Model (DOM) using the .Object property in a function. In the following example the cookie collection is returned the from the browser.

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

  • How does QuickTest handle session IDs?
  • The server, not the browser, handles session IDs, usually by a cookie or by embedding the session ID in all links. This does not affect QuickTest.

  • How does QuickTest handle server redirections?
  • When the server redirects the client, the client generally does not notice the redirection, and misdirections generally do not occur. In most cases, the client is redirected to another script. on the server. This additional script. produces the HTML code for the subsequent page to be viewed. This has no effect on QuickTest or the browser.

  • How does QuickTest handle meta. tags?
  • Meta. tags do not affect how the page is displayed. Generally, they contain information only about who created the page, how often it is updated, what the page is about, and which keywords represent the page's content. Therefore, QuickTest has no problem handling meta. tags.

  • Does QuickTest work with .asp and .jsp?
  • Dynamically created Web pages utilizing Active Server Page technology have an .asp extension. Dynamically created Web pages utilizing Java Server Page technology have a .jsp extension. These technologies are completely server-side and have no bearing on QuickTest.

  • Does QuickTest work with COM?
  • QuickTest complies with the COM standard.

    QuickTest supports COM objects embedded in Web pages (which are currently accessible only using Microsoft Internet Explorer) and you can drive COM objects in VBScript.

  • Does QuickTest work with XML?
  • XML is eXtensible Markup Language, a pared-down version of SGML for Web documents, that enables Web designers to create their own customized tags. QuickTest supports XML and recognizes XML tags as objects.

    For more information, see the HP QuickTest Professional User's Guide, and the XMLUtil object in the Utility section of the HP QuickTest Professional Object Model Reference.

  • How can I access HTML tags directly?
  • QuickTest provides direct access to the Internet Explorer's Document Object Model (DOM) through which you can access the HTML tags directly. Access to the DOM is performed using the .Object notation.

    The function below demonstrates how to iterate over all the tags in an Internet Explorer page. The function then outputs the inner-text of the tags (the text contained between the tags) to the Test Results using the Reporter object.

    ' Use the on error option 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 test results.

           Reporter.ReportEvent 0, TagName, InnerText

    Next

    • Where can I find information on the Internet Explorer Document Object Model?

    For information on the Internet Explorer DOM, browse to the following Web sites:

    Document object:
    http://msdn2.microsoft.com/en-us/library/ms531073.aspx

    Other DHTML objects:
    http://msdn2.microsoft.com/en-us/library/ms533054.aspx

    General DHTML reference:
    http://msdn2.microsoft.com/en-us/library/ms533050.aspx

    • How can I send keyboard key commands (such as shortcut commands) to objects that do not support the Type method?

    For objects that do not support the Type method, use the Windows Scripting SendKeys method. For more information, see the Microsoft VBScript. Language Reference (choose Help > QuickTest Professional Help > VBScript. Windows Script. Host).  

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16792402/viewspace-571206/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-02-22

  • 博文量
    140
  • 访问量
    74096