WinRunner(Invoking Flight Reservation)

Posted by Hitesh Chopra on in Testing

It is a sample application we are going to test in Winrunner.

Steps:-

1.) Open Win Runner

2.) Press F2(Start Recording).

3.) Press F7

4.) Select Invoke Application.

5.) Click Args.

6.) Click browse.

7.) Open C://Program Files/Mercury Interactive/WinRunner/Samples/Flight/app/flight1a

8.) Click Open

9.) Click Paste

10.) Click Execute.

11.) Input Agent Name,Password as “mercury”(always to open this).

12.) Click Ok,(Closes Fucntion Generator)

13.) Stop Recording.

14.) Closes Flight Reservation.

15.) Run the recorded Script

Tags: , , , ,

 

WinRunner

Posted by Hitesh Chopra on in Testing

It is a functional regression testing tool developed by mercury interactive corporation.

Invoke Application

1.)It is an initial concept to establish a logical link between application & testing tool.

2.)Identifies whether the application invokes easily or not.

CALCULATOR -> Windows simple Application to invoke or invoke_application

Invoking Calculator

Steps:->

1.) Open Winrunner.

2.) Select blank text.

3.) Press F2=>(start recording)

4.) Press F7=> invoke application “path”.

5.) Function Generator(pre-defined functions),We can also select functions out of given.

6.) Establish link between application & tool.

7.) Select invoke_application.

8.) Click args(arguments).

9.) Click browse(….).

10.) Click C:/Windows/System32/calc.

11.) Click open.

12.) Click paste.

13.) Click close(Closes Function Generator).

14.) Click Stop.

15.) Click Run from TOP.

16.) Click Ok

Tags: , , ,

 

Automation Testing

Posted by Hitesh Chopra on in Testing

Automation Testing:-  It is a modern technique followed based on software engineering ISO, IEEE standards.

Why Automation Testing:-  Automated software testing is the best way to increase the effectiveness, efficiency and coverage of your software testing.

How Automation Testing Works: Automation Software Testing Tool is able to playback pre-recorded and predefined actions, compare the results to the expected behavior and report the success or failure of these manual tests to a test engineer. Once automated tests are created they can easily be repeated and they can be extended to perform tasks impossible with manual testing. Because of this, savvy managers have found that automated software testing is an essential component of successful development projects.

AUTOMATION SOFTWARE TESTING TOOLS

SUITE ->  A suite is a combination of functionality,reporting & performance tools.

The Popular suits are:

1.) Mercury

2.) SEGUE

3.) SQA(Software Quality Assurance)

MERCURY

This is a suite developed by mercury interactive corporation. Initially,they concentrated on windows based applications, now on web.In 2008, Mercury was owned by HP.

1.) WIN RUNNER-> It is a functional testing tool created by Mercury. It supports the technologies like VB,POWER BUILDER,ORACLE,ACTIVEX CONTROLS,JAVA(Only last version).

2.) TEST DIRECTOR-> This is a test management tool(Reporting tool) generated the reports automatically for winrunner.

3.) Load Runner-> It is a performance tool supports almost all the technologies.

SEGUE(Russia)

This  is a testing suite implemented by segue incorporation. They concentrated on mostly windows based,console-based & web-based.

1.)Silk Test (Functional Testing Tool) ->Extensions supported by SilkTest: .NET, Java, DOM, IE, Firefox.

2.) Silk Manager-> It is a testing management tool.

3.) Silk Performance-> It is a performance tool.

SQA(Software Quality Assurance)/Rational/IBM

SQA Robot(Functional Testing Tool)-> It supports D2K,SAP,Siebel, C R M,ORACLE,FOX PRO,JAVA,VB,POWER BUILDER.It doesn’t support .net

SQA TEST LOG VIEWER-> It is testing management tool.

SQA STRESS-> It is performance tool.

MERCURY/H.P

QTP(Quick Test Professional)-> 1.) It is a functional testing tool.

2.)It is combination of winrunner+segue+SQA

3.) It supports VB,JAVA,.NET,ERP,ORACLE,FOXPRO,C,C++,Pascal,COBOL,Multimedia.

Quality Center->(Testing Management Tool)-> It supports all mercury Test Director,Winrunner,QTP.

Tags: , , , , , ,

 

Subversion – Rules, Crash Course and Work Cycle

Posted by $umeet $oni on in SVN

RULES

Rule #1:  Check in only completed functioning code that you believe works.  Bugs may be found later, but don’t check in anything that you know is incomplete or broken.

Rule #2:  Check in as often as possible without breaking rule #1.

Rule #3:  Always perform an update before a check-in.

Rule #4:  Reference the svn red book often.  http://svnbook.red-bean.com/

Rule #5:  Do not mess around with the .svn directories in the check-out unless you’re an expert with subversion.

CRASH COURSE:
Subversion (svn) is a source code repository like microsoft sourcesafe, cvs, or borland starteam.  The main repository we use is called simply ‘main’.  Beneath main, everything is organized into projects.  There is a project for the main website itself, called ‘webroot’.  Each project is organized into branches (created at release), and “trunk” where development occurs.
There are a few main functions to svn that you need to be familiar with.

  1. Checkout – This is how you get a copy of the project.
  2. Diff – Use this before commit to make sure you are only checking in things you intend to check in.
  3. Commit – This sends your changes to the server, this is how you check in.
  4. Status – This will list which files are changed or new.
  5. Add – Use this to add new files you create to the repository. Must be followed by a commit.
  6. Update – This brings down any changed files.  It will attempt to merge, and warn on failure, if a file on the server has been changed since the last time you ran an update, and your local copy is modified.

Again, read the red book.

WORK CYCLE:

  1. Checkout the project.
  2. Modify files and test modifications.
  3. Update.
  4. Any new files or directories need to be ADDed.
  5. Update.
  6. Repeat 2-4 until your changes are ready to be sent up.
  7. Commit.

Tags: , , ,

 

How to install, configure and use SVN (Subversion)

Posted by $umeet $oni on in SVN, TortoiseSVN
  1. To access your online repository (http://dev.w3syntactic.com/poemsandgifts/) from your Windows based operating system, you should install one of the SVN client applications. Here, we will be discussing about TortoiseSVN.
  2. To install TortoiseSVN client application on your system, you can find it at http://tortoisesvn.tigris.org or rather at http://tortoisesvn.net/downloads.
  3. There you will find two types of installers – one for 32-bit operating systems and another one for 64-bit operating systems. To check how many bit operating system you have – click here.
    tortoiseSVN download

    TortoiseSVN Download

  4. Once you have downloaded the right version of TortoiseSVN. Get it installed with the default selections with the installer on your system. If successfully installed, it will ask you to restart your system. Thus, get your system restarted and in the meanwhile, let me take a small break ;)
  5. So, once your system is back and running, move to the next step…
  6. The Tortoise SVN adds its functionality in the Windows Explorer Context Menu

    tortoisesvn windows explorer context menu

    TortoiseSVN - Windows Explorer Context Menu

  7. Verifying the connection to the SVN Server – Right click on any folder in the Windows Explorer and select TortoiseSVN -> “Repo-browser”. You will be asked for a path to the repository, enter the path to the SVN repository. Below is an example to demonstrate the same:

    TortoiseSVN Repo Browser

    TortoiseSVN - Repo Browser

  8. If you already have the folder of your project with any of the files in it on your local system then you can straightaway move to next step otherwise, lets create a folder preferably at C:\wamp\www\yourprojectfoldername and create a file named as index.html or phpinfo.php
  9. Importing files to online SVN repository for the first time – In case, you are uploading the files to this new project to the SVN for the first time, right click on the folder from which you have to move the files to the online SVN repository and a context menu will come up, select “TortiseSVN > Import” and the following screen will come up:

    TortiseSVN Import

    TortoiseSVN - Import

  10. Once you have imported the files to SVN repository and now, if you check the same online it should look somewhat like this:

    Browser - SVN Revisions

    Browser - SVN Revisions

  11. Getting the files from the repository – To get the files from the online repository, right click on the project directory on your local system and select “SVN Checkout…” from the context menu. You will see the following screen:

    tortiseSVN Checkout

    TortoiseSVN - Checkout

    If you followed all the steps the address of the repository should be already written here. All you have to do is click “OK”

    TortiseSVN - Checkout 2

    TortoiseSVN - Checkout 2

    This means we have checked out the files successfully and we can start working!
    The directory should look like this:

    Windows Explorer - Directory Structure Using SVN

    Windows Explorer - Directory Structure Using SVN

    The Green tick marks mean that nothing has changed inside the directory on our local system. Let’s add a new file to the base folder / directory and name it “readme.txt”. We will then “Right Click” on the base folder and select “Commit”.

  12. The new file that has been just added by us will look like this:
    TortiseSVN - Adding New File

    TortoiseSVN - Adding New File

  13. SVN Commit – Come to base folder, right click and select “SVN Commit…” from the context menu. The SVN Server has detected that you have added a new file and you will have to check the Checkbox next to it in order for it to be inserted to the repository.

    TortoiseSVN - Commit

    TortoiseSVN - Commit

  14. Committing and Commenting – One must practice good commenting before committing anything on the live repository.

    TortoiseSVN - Commenting

    TortoiseSVN - Commenting

    Once committed successfully, it will look like the following image:

    TortoiseSVN - Commit Dialog Box

    TortoiseSVN - Commit Dialog Box

    Let’s edit “readme.txt” file and add some text in it. Once edited, both – the file and the directory will get a red exclamation mark saying they have been changed:

    TortoiseSVN - Edit

    TortoiseSVN - Edit

    To send the changes to the server / repository, you can right click any of them and again, select “SVN Commit…” from the context menu. Doing it on the Folder will make the Commit recursive to all the files inside it.

Tags: , ,

 

Installing Subversion (SVN) using Dreamhost

Posted by $umeet $oni on in Dreamhost, SVN
  1. Login to your dreamhost account.
  2. On the left navigation bar, click on Goodies and then “Subversion”

    Dreamhost Subversion

    Dreamhost Subversion

  3. Under “Create a new Subversion Project:” – input all the necessary values and click on the button called “Create my new project repository now!”

    Dreamhost Create a Subversion Project

    Dreamhost - Create a Subversion Project

  4. Once after clicking on that button and if everything has been inputted correctly, your request for the SVN for your new project will be submitted and you will be provided with a message something similar to the below one:
  5. Once your project’s subversion has been created online and once you will open up the subversion in your browser for the first time, it will look somewhat like this:

Tags: ,

 

PHP script – how to find the working days from a specified date?

Posted by Deepak Saini on in PHP

<?php

/*

This is a function to find out working days from a specified date and  format of date must be dd-mm-yyyy

First parameter to function is the date from which working days are to be calculated (working day exclude Sun and Sat)

Second parameter to function is the number of working days to be calculated

*/

function workingDays( $fromDate, $interval )  {

$date_array = explode(‘-’, $fromDate );

$day                      = $date_array[0];

$month                                = $date_array[1];

$year                     = $date_array[2];

$working_date = array();

for ( $i = 1;  $i <= $interval; $i++ )               {

$day_text = date(“D”, mktime( 0, 0, 0,$month,$day + (int)$i,$year));

if( $day_text == ‘Sat’ || $day_text == ‘Sun’ )  {

$interval++;

continue;

}

$working_date[] = date(“F j, Y”, mktime(0, 0, 0,$month,$day +(int)$i,$year));

}

return $working_date;

}

$getWorkingDays = workingDays(’19-05-2010′, 10 );

echo “<pre>————————–Array with all working days ————————————–<br/>”;

print_r($getWorkingDays);

echo “——————————- Last working day—————————————————<br/>”;

echo $getWorkingDays[count($getWorkingDays)-1];

?>



Tags: , , , ,

 

How to check if Windows 7, Vista, XP or Server 2003 is 32-bit or 64-bit (x86 or x64) version?

Posted by $umeet $oni on in Windows

Windows Vista

Method 1

  1. Click Start, then click on Run or Start Search.
  2. Type msinfo32.exe and then press Enter key.
  3. In “System Information”, review the value for the System Type item:
    • For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
    • For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

Method 2

  1. Click Start, type system in the “Start Search” box, and then click system in the “Programs” list.
  2. The operating system appears as follows:
    • For a 64-bit version operating system: 64-bit Operating System appears for the “System type” under “System”.
    • For a 32-bit version operating system: 32-bit Operating System appears for the “System type” under “System”.

Method 3

  1. Click Start, type system in the “Start Search” box, and then click System Information in the “Programs” list.
  2. The operating system appears as follows:
    • For a 64-bit version operating system: x64-based PC appears for the “System type” under “Item”.
    • For a 32-bit version operating system: x86-based PC appears for the “System type” under “Item”.

Microsoft Windows XP Professional

Method 1

  1. Click Start, then click on Run or Start Search.
  2. Type msinfo32.exe and then press Enter key.
  3. In “System Information”, review the value for the System Type item:
    • For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
    • For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

Method 2

  1. Click Start, click Run, type sysdm.cpl, and then click OK.
  2. Click the General tab. The operating system appears as follows:
    • For a 64-bit version operating system: Microsoft Windows XP Professional x64 Edition Version <Year> appears under System.
    • For a 32-bit version operating system: Microsoft Windows XP Professional Version <Year> appears under System.

    Note <Year> is a placeholder for a year.

Method 3

  1. Click Start, click Run, type winmsd.exe, and then click OK.
  2. In the details pane, locate Processor under Item. Note the value.
    • If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of the Windows operating system.
    • If the value that corresponds to Processor starts with ia64 or AMD64, the computer is running a 64-bit version of the Windows operating system.

Microsoft Windows Server 2003

Method 1

  1. Click Start, click Run, type sysdm.cpl, and then click OK.
  2. Click the General tab. The operating system appears as follows:
    • For a 64-bit version operating system: Microsoft Windows Server 2003 Enterprise x64 Edition appears under System.
    • For a 32-bit version operating system: Microsoft Windows Server 2003 Enterprise Edition appears under System.

Method 2

  1. Click Start, click Run, type winmsd.exe, and then click OK.
  2. In the details pane, locate Processor under Item. Note the value.
    • If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of the Windows operating system.
    • If the value that corresponds to Processor starts with EM64T or ia64, the computer is running a 64-bit version of the Windows operating system.
<Year>


 
Original details on the same article can be found here.

Tags: , , , , , ,

 

How to convert HTML to PDF using PHP 5

Posted by Aman Brar on in HTML, PDF, PHP

There are many tools on the internet that allow you to convert files of various formats to PDF – but sometimes you need to make such conversions using your code. In this article, we’ll specifically discuss how to convert an HTML file or content to a PDF file using PHP 5.

For the task at hand, we’ll be using Dompdf – a CSS2.1 compliant HTML layout and rendering engine written in PHP. It is a style-driven renderer – it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes.

  1. Installation

    • Download the latest stable version of Dompdf, additionally you can also download the detailed documentation if needed. You can get them from here.
    • Untar/unzip the source package in a directory accessible by your webserver; for example: “\www\dompdf”
    • Edit dompdf_config.inc.php to fit varous parameters for your installation; generally you should not need to change anything and it should work with default settings.
    • Give your webserver write permission on the path specified in DOMPDF_FONT_DIR (lib/fonts by default). Under *nix, ideally you can make the webserver group the owner of this directory and give the directory group write permissions. For example, on Debian systems, apache runs as the www-data user:
      $ chgrp www-data lib/fonts
      $ chmod g+w lib/fonts

      If your user is not a member of the www-data group or you do not have root priviledges, you can make the directory world writable and set the sticky bit:

      $ chmod 1777 lib/fonts

  2. Usage

    • Invoking dompdf via the web

      The dompdf.php script receives input parameters via $_GET and can stream a PDF directly to the browser. dompdf.php accepts the following $_GET variables:

      input_file required a rawurlencoded() path to the HTML file to process. Remote files (http/ftp) are supported if fopen wrappers are enabled.
      paper optional the paper size. Defaults to ‘letter’ (unless the default has been changed in dompdf_config.inc.php). See include/pdf_adapter.cls.php, or invoke dompdf.php on the command line with the -l switch for accepted paper sizes.
      orientation optional ‘portrait’ or ‘landscape’. Defaults to ‘portrait’.
      base_path optional the base path to use when resolving relative links (images or CSS files). Defaults to the directory containing the file being accessed. (This option is useful for pointing dompdf at your CSS files even though the HTML file may be elsewhere.)
      output_file optional the rawurlencoded() name of the output file. Defaults to ‘dompdf_out.pdf’.
      save_file optional If present (i.e. isset($_GET["save_file"]) == true’);), output_file is saved locally, Otherwise the file is streamed directly to the client.


      <?php

      $url = "dompdf.php?input_file=" . rawurlencode("path_to_the_file_to_be_converted.html") . "&paper=letter&output_file=" . rawurlencode("my_output_filename.pdf");

      header("Location: http://" . $_SERVER["HTTP_HOST"] . "/$url");

      ?>

    • Using the dompdf class directly

      Using the dompdf class directly is fairly straightforward:

      <?php

      require_once("dompdf_config.inc.php");
      $html = "<html><body>" . "<p>Put your html here, or generate it with your favourite " . "templating system.</p>" . "</body></html>";

      $dompdf = new DOMPDF();
      $dompdf->load_html($html);
      $dompdf->render();
      $dompdf->stream("sample.pdf");

      ?>

 

For complete details, see the Usage instructions and API documentation for the class interface definition.

Tags: , ,

 

How to develop a website in Hindi

Posted by Aman Brar on in CSS, Fonts, HTML

You can develop a website in Hindi – or any other language – by embedding custom dynamic fonts. Although, embedding custom fonts has always been a painful experience for web developers and designers, but the latest trends in web design brought the idea back to life with new techniques. In this article you’ll find the modern techniques that may help you with the topic at hand, however, one must note that no particular technique is perfectly compatible with every browser and each has its pros and cons.

SIFR
sIFR (Scalable Inman Flash Replacement) is a technique that replaces text elements on screen with Flash equivalents. Needless to say that website visitors must have Adobe Flash Player installed to see the custom fonts, otherwise default fonts will be used. Also, the current stable sIFR release (2.0.7) has some drawbacks, i.e. you can’t use CSS styling, applying custom fonts to links is hardly possible and the developer needs an Adobe Flash editor to generate .swf files for each custom font.

CUFON
Cufon is a fast and pure Javascript replacement to sIFR. The font files need to be converted into VML path, that can be made only with Cufon’s font generator. In addition to this there is another JS file that needs to be included. Advantage of this technique is that it works not only with TrueType (TTF) but also with OpenType (OTF), Printer Font Binary (PFB) and PostScript fonts. And it is also possible to style elements with CSS.

TYPEFACE.JS
Typeface is quite similar to Cufon – a JS file is to be included in the webpage, and their online generator needs to be used to generate fonts. It is also easy to use on a webpage, just type the CSS directive “font-family: YourFont” and you get it embedded. Two main limitations are that only TTF fonts can be used with Typeface.js, and it sometimes cuts characters in the end and the phrases becomes incomplete – for some unknown reason.

FONTJAZZ
FontJazz is a tiny typographic engine written in JavaScript, enabling web designers and developers to use any typeface on a website. Solution is a bit similar to Cufon and Typeface.js. With FontJazz you need to generate font file on their website (single .gif file and js-map array) then Javascript library will use it as a sprite image (solution is similar to CSS sprites).

FLIR
FLIR (Facelift Image Replacement) is an image replacement script that dynamically generates image representations of the text label and automatically inserts it using Javascript into the webpage. FLIR has PHP-based server-side part that can be a big disadvantage not only for ASP.NET, Java, Ruby, Python developers but also for the HTML slicers/coders.

 

Below are the details on using Cufón (the technique recommended at this time).

Step 1 – Getting Cufón
It is highly recommended that you always use the YUI-compressed version of Cufón, available at the Cufón website. Should you experience problems with the compressed version, you may also use the uncompressed version.

Step 2 – Generate the font
Use the font generator at Cufón website to generate the required font file.

Step 3 – Replacing text
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <script src="cufon-yui.js" type="text/javascript"></script>
  <script src="Vegur_300.font.js" type="text/javascript"></script>
  <script type="text/javascript">
    Cufon.replace('h1');
  </script>
</head>
<body>
  <h1>This text will be shown in Vegur.</h1>
</body>
</html>

First, we include the YUI compressed version of cufón.

Then we include the font that we converted in Step 2. Nothing special here, you include it just like you would any other JavaScript file.

Then we get to part where we implement the font to the elements in the document. And that’s exactly what you tell Cufón to do, with Cufon.replace('h1'). Nothing else is needed, Cufón will use the CSS rules associated with the elements and determine what to do.

Step 4 – Making Internet Explorer behave
Unfortunately one problem remains with Internet Explorer. In most cases, there is a short but visible delay before the text is replaced. You can avoid this issue by inserting the following snippet right before the closing </body> tag (or before any external scripts such as Google Analytics):
  <script type="text/javascript"> Cufon.now(); </script>

Using multiple fonts
To use multiple fonts you only need to specify which font you want to use and you’re set:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <script src="cufon-yui.js" type="text/javascript"></script>
  <script src="Vegur_300.font.js" type="text/javascript"></script>
  <script src="Myriad_Pro_400.font.js" type="text/javascript"></script>
  <script type="text/javascript">
    Cufon.replace('h1', { fontFamily: 'Vegur' });
    Cufon.replace('h2', { fontFamily: 'Myriad Pro' });
  </script>
</head>
<body>
  <h1>This text will be shown in Vegur.</h1>
  <h2>This text will be shown in Myriad Pro.</h2>
</body>
</html>

If not specified, Cufón will use the font that was loaded last (in this case it would be Myriad Pro), which is why there was no need to specify the font in the first example.

Tags: , , ,