Monday, 19 August 2013

Can we create the window application with VBScipt?

An HTML Application (HTA) is a Microsoft Windows application written with HTML and Dynamic HTML. The ability to write HTAs was introduced with Microsoft Internet Explorer 5.0.
HTAs can be made from regular HTML files by simply changing the file extension to .hta. A regular HTML file is confined to the security model of the web browser – i.e. to communicating with the server, manipulating the page’s object model (usually to validate forms and / or create interesting visual effects) and reading / writing cookies. An HTA runs as a fully trusted application and therefore has more privileges than a normal HTML file – for example an HTA can create / edit / remove files and registry entries.
To customize the appearance of an HTA, a new tag, with attributes, is introduced: . This tag appears in the … section of an HTA document.
Because an HTA has more privileges than an HTML page, it cannot be executed via http. Rather, the HTA must be downloaded (just like an EXE file) and executed from local file system.
QTP code Generates for a HTML Application
QTP generates the code as similar to the normal web applications, except that it shows window instead of browser
Example: If the HTML Application has a edit box then code will be
Window(..).Webedit(…).set “value”
Sample code :
This example code creates a HTML app with 3 edit boxes.
Sub SetNameColor
If Len(UserName.Value) 0 Then
UserName.style.background = “cyan”
Else
UserName.style.background = “yellow”
End If
End Sub
Name
Address
Phone
For More information on HTML Application Refer:
References:MSDN

No comments:

Post a Comment