Advanced Web issues

Relevant for: GUI tests and components

How does UFT One 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.

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

Back to top

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 (for components, you do this in a user-defined function). In the following example the cookie collection is returned the from the browser:

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

Back to top

How does UFT One 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 UFT One.

Back to top

How does UFT One 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 UFT One or the browser.

Back to top

How does UFT One 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, UFT One has no problem handling meta tags.

Back to top

Does UFT One 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 UFT One.

Back to top

How does UFT One support advanced Web controls?

You can use UFT One Web Add-in Extensibility to add your own support for custom Web controls. The Web Add-in Extensibility SDK installs a sample toolkit support set that provides partial support for some advanced Web controls. You can use this sample to learn how to create your own support for your controls. For more details, see the UFT OneWeb Add-in Extensibility Developer Guide.

Back to top

Does UFT One work with COM?

UFT One complies with the COM standard.

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

Back to top

Does UFT One 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. UFT One supports XML and recognizes XML tags as objects.

For tests and scripted components: You can also create XML checkpoints to check the content of XML documents in Web pages, frames or files. UFT One also supports XML output and schema validation.

For more details, see XML checkpoints, and the XMLUtil object in the Utility Objects section of the UFT One Object Model Reference for GUI Testing.

Back to top

How can I access HTML tags directly?

UFT One 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 run 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 run results.
    Reporter.ReportEvent 0, TagName, InnerText
Next

Back to top

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 details, see VBScript Reference.

Back to top

See also: