Can we create the window application with VBScipt?
Can we create the window application with VBScipt?
yes: using HTML Application (HTA)
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: <hta:application …>. This tag appears in the <head>…</head> 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.
<SCRIPT Language=”VBScript”>
Sub SetNameColor
If Len(UserName.Value) <> 0 Then
UserName.style.background = “cyan”
Else
UserName.style.background = “yellow”
End If
End Sub
</SCRIPT>
<body>
Name<br>
<input type=”text” name=”UserName” size=”25″ style=”background-color:yellow” onChange=”SetNameColor”><p>
Address<br>
<input type=”text” name=”Address” size=”25″><p>
Phone<br>
<input type=”text” name=”Phone” size=”25″><p>
</body>
For More information on HTML Application Refer:
http://msdn2.microsoft.com/en-us/library/ms536496.aspx
http://www.microsoft.com/technet/scriptcenter/resources/qanda/htas.mspx
References:MSDN
-
Archives
- July 2011 (1)
- March 2011 (1)
- November 2010 (1)
- November 2008 (4)
- October 2008 (2)
- September 2008 (2)
- June 2008 (1)
- March 2008 (4)
- February 2008 (44)
-
Categories
- Automated Test Script Creation Process
- Automating MS Word
- Automating QC
- Automation Object Model For QTP
- Backward compatability in QTP
- Browser Scripts
- COM and QTP
- compare 2 text files
- Descriptive programming
- Descriptive Programming and Child Objetcs
- Dictonary Object
- DotNetFactory
- Excel Automation
- Extra Topics
- Files and Folders
- General Standards to be followed in Test scripts
- New Features In QTP9.5
- QC-OTA
- QTP Additional Faqs
- QTP Faqs
- QTP Naming Convention
- QTP Tips and Faqs
- Running stored procedures from QTP
- Send keyboard keys
- Uncategorized
- Uninstall a software using QTP
- Uninstall a software using vbscript
- Update data in a database
- VBScript and IE Automation
- VBScript Faqs and Useful resources
- What’s New in Quick Test Pro 9.0
- Whats New in QTP 9.5
- XML Scripting
-
RSS
Entries RSS
Comments RSS