Advanced Web issues
Relevant for: GUI tests and components
How does UFT One handle cookies?
UFT One 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 (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
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.
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.
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.
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.
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 One<![CDATA[ ]]>Web Add-in Extensibility Developer Guide.
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.
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.
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
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.