Tuesday, October 4, 2011

Export QTP Result as a HTML Page

The Quick Test Professional has an in built functionality to Export Test Results in PDF, Excel or HTML file but if the user want to Export the Test Result via descriptive programming and user defined function than the below code will be helpful.

This below simple code for "Export QTP Result as a HTML Page" is modifiable and developed with VB Script.

Function Declaration :
Public Function GenerateHTMLReport(ByVal inputXML, ByVal inputXSL, ByVal outputFile)
   sXMLLib = "MSXML.DOMDocument"
   Set xmlDoc = CreateObject(sXMLLib)
   Set xslDoc = CreateObject(sXMLLib)
   xmlDoc.async = False
   xslDoc.async = False

   xslDoc.load inputXSL

   xmlDoc.load inputXML

   outputText = xmlDoc.transformNode(xslDoc.documentElement)

   Set FSO = CreateObject("Scripting.FileSystemObject")
   Set outFile = FSO.CreateTextFile(outputFile,True)
   outFile.Write outputText
   outFile.Close
   Set outFile = Nothing
   Set FSO = Nothing
   Set xmlDoc = Nothing
   Set xslDoc = Nothing
   Set xmlResults = Nothing

 End Function

Use of Function :
Dim sResultsXML, sDetailedXSL
sResultsXML is for define full path of the Result.xml file.
sDetailedXSL is for QTP inbuilt PDetails.xsl file for format the Result.xml file.

For Example :
sResultsXML = "C:\Temp\TempResults\Report\Results.xml"
sDetailedXSL = "C:\Program Files\HP\QuickTest Professional\dat\PDetails.xsl"

Function Call :
GenerateHTMLReport sResultsXML, sDetailedXSL, "Path for save the Exported HTML file"

Monday, October 3, 2011

Visual Studio 2011 and .NET Framework 4.5 developer

There is a Fantastic news from the Microsoft for developer because microsoft recently announced the Visual Studio 2011 and .NET Framework 4.5 developer preview in Anaheim, California. There are some new features at this movement with Visual Studio 2011 and .NET Framework 4.5 developer preview are as under

1.) Visual Studio 2011 developer preview Features

- Develop Metro style Apps for Windows 8
- Enhancements for Game Development
- Code Clone Analysis
- Code Review Workflow
2.) .NET Framework 4.5 developer preview Features

- State machine support in Windows Workflow
- Improved support for SQL Server and Windows Azure in ADO.NET
- ASP.NET has increased investments in HTML5, CSS3, device detection, page optimization, as well as new functionality with MVC4

Wednesday, September 14, 2011

Javascript Confirm Message Box

This is the simple and easiest way to create a JavaScript confirm message box. A JavaScript confirm message box is similar to an alert box.with the JavaScript confirm message box the user can get two choices — OK and Cancel button in the message box. One ristriction with the JavaScript confirm message box is that You can't change the names of the choices but you can determine what they do.

<html>
<head>
<script type="text/javascript">
function showConfirmBox()
{
     var r=confirm("Kindly Press a button!");
     if (r==true)
    {
         alert("You just pressed OK!");
    }
   else
   {
        alert("You just pressed Cancel!");
    }
}
</script>
</head>
<body>
<input type="button" onclick=" showConfirmBox ()" value="Click here for confirm box" />
</body>
</html>

Tuesday, August 9, 2011

SQL Server Report With Asp.net Application

This article features integration of SQL Server Report With Asp.net Application. To call SQL Server Reports With Asp.net Application from front end can be acheived in few steps as under. 
Solution 1 : Direct Load Report in Application.
  1. Create a new website.
  2. Add the report viewer to a form.
  3. Change the ProcessingMode to Remote.
  4. Also change the AsyncRendering to FALSE.
  5. Then assign two properites to the report viewer:
    • ReportViewer1.ServerReport.ReportServerUrl 
    • ReportViewer1.ServerReport.ReportPath 
Report should then pop up in your page.

Solution 2 : Load the report on click of the menus on a web page.

  1. Click the smart tag which is located on the top left corner or the ReportViewer to show the ReportViewer Tasks panel.
  2. In the Choose Report dropdown list, select to display report on the Report Server.
  3. Type in the Report Server Url in the Report Server Url textbox like Exe:-http://servername/reportserver.
  4. Keep the Report Path textbox blank.
  5. In the click event handler of the menu, type in the code below to specify the report dynamically:
    • ReportViewer1.ServerReport.ReportPath ="/FolderName/ReportName"; 
    • ReportViewer1.ServerReport.Refresh();
 After that, the ReportViewer would not display report until click the menu.

Tuesday, November 16, 2010

When ASP.NET Application Restart?

The list of situations

  1. Adding, modifying, or deleting the application's Web.config file.
    • This is very important situation here, if we are add any new section or modify existing section i web configuration file, the IIS will treat as change and then lead to restart the ASP.NET Application. And more important when Application restart all the sessions and other states will lost. so make sure before update anything in web config file, all the transaction has been completed.
  2. Adding, modifying, or deleting assemblies from the application's Bin folder.
  3. Adding, modifying, or deleting localization resources from the App_GlobalResources or App_LocalResources folders.
  4. Adding, modifying, or deleting the application's Global.asax file.
  5. Adding, modifying, or deleting source code files in the App_Code directory.
    • This is very important situation here, if we are add any new section or modify existing section i web configuration file, the IIS will treat as change and then lead to restart the ASP.NET Application. And more important when Application restart all the sessions and other states will lost. so make sure before update anything in web config file, all the transaction has been completed.
  6. Adding, modifying, or deleting Web service references in the App_WebReferences directory.
This is very smal tip, but most useful, who are working production asp.net application.